arnaucube
arnaucube/circomPublic Self-hosted repository
Big component entry tables
Jordi Baylina jordi@baylina.cat
Mon, 17 Aug 2020 12:02:24 +0200
commit

f02ceb2508f4f32fc49d8df43948734dcc6a7d92

parent

d014d67032e3b0d07d263521e514b1150dc486fa

2 files changed, 6 insertions(+), 8 deletions(-)

jump to
M ports/c/builder.js → ports/c/builder.js

@@ -356,7 +356,6 @@

this.sizePointers = {}; this.hashMapPointers = {}; - this.cetPointers = {}; this.functionIdx = {}; this.nCets = 0; }

@@ -370,11 +369,11 @@ addHashMap(name, hm) {

this.hashMaps[name] = hm; } - addComponentEntriesTable(name, cet) { - this.componentEntriesTables.push({ + addComponentEntriesTable(name, cet, idComponent) { + this.componentEntriesTables[idComponent] = { name: name, cet: cet - }); + }; } addSizes(name, accSizes) {

@@ -462,10 +461,9 @@ while (fdData.pos % 8) fdData.pos++;

this.pCets = fdData.pos; for (let i=0; i< this.componentEntriesTables.length; i++) { if ((this.verbose)&&(i%100000 ==0)) console.log(`_buildComponentEntriesTables ${i}/${this.componentEntriesTables.length}`); - const cetName = this.componentEntriesTables[i].name; const cet = this.componentEntriesTables[i].cet; - this.cetPointers[cetName] = fdData.pos; + this.components[i].entryTablePointer = fdData.pos; const buff = new Uint8Array(16*cet.length); const buffV = new DataView(buff.buffer);

@@ -612,7 +610,7 @@ if ((this.verbose)&&(i%1000000 ==0)) console.log(`_buildComponents ${i}/${this.components.length}`);

const c = this.components[i]; utils.setUint64(buffV, 0, this.hashMapPointers[c.hashMapName], true); - utils.setUint64(buffV, 8, this.cetPointers[c.entryTableName], true); + utils.setUint64(buffV, 8, c.entryTablePointer, true); utils.setUint64(buffV, 16, this.functionIdx[c.functionName], true); buffV.setUint32(24, c.nInSignals, true); buffV.setUint32(28, c.newThread ? 1 : 0, true);
M src/build.js → src/build.js

@@ -78,7 +78,7 @@ type: entry.type

}); } - ctx.builder.addComponentEntriesTable(componentEntriesTableName, componentEntriesTable); + ctx.builder.addComponentEntriesTable(componentEntriesTableName, componentEntriesTable, i); ctx.components[i].htName = htName; ctx.components[i].etName = componentEntriesTableName;