mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-07 03:06:42 +01:00
NPublic in code
This commit is contained in:
@@ -693,6 +693,15 @@ module.exports = function buildRuntime(module, builder) {
|
||||
f.addCode(c.i32_const(builder.header.NVars));
|
||||
}
|
||||
|
||||
function buildGetNPublic() {
|
||||
const f = module.addFunction("getNPublic");
|
||||
f.setReturnType("i32");
|
||||
|
||||
const c = f.getCodeBuilder();
|
||||
|
||||
f.addCode(c.i32_const(builder.header.NPublic));
|
||||
}
|
||||
|
||||
function buildGetFrLen() {
|
||||
const f = module.addFunction("getFrLen");
|
||||
f.setReturnType("i32");
|
||||
@@ -892,6 +901,7 @@ module.exports = function buildRuntime(module, builder) {
|
||||
buildCheckAssert();
|
||||
|
||||
buildGetNVars();
|
||||
buildGetNPublic();
|
||||
buildGetFrLen();
|
||||
buildGetPWitness();
|
||||
buildGetPRawPrime();
|
||||
@@ -901,6 +911,7 @@ module.exports = function buildRuntime(module, builder) {
|
||||
|
||||
module.exportFunction("init");
|
||||
module.exportFunction("getNVars");
|
||||
module.exportFunction("getNPublic");
|
||||
module.exportFunction("getFrLen");
|
||||
module.exportFunction("getSignalOffset32");
|
||||
module.exportFunction("setSignal");
|
||||
|
||||
@@ -781,20 +781,21 @@ class BuilderWasm {
|
||||
|
||||
_buildHeader(module) {
|
||||
|
||||
this.pCircuit = module.alloc(48);
|
||||
this.pCircuit = module.alloc(52);
|
||||
|
||||
this.pNSignals = this.pCircuit;
|
||||
this.pNComponents = this.pCircuit + 4;
|
||||
this.pNInputs = this.pCircuit + 8;
|
||||
this.pNOutputs = this.pCircuit + 12;
|
||||
this.pNVars = this.pCircuit + 16;
|
||||
this.ppWit2sig = this.pCircuit + 20;
|
||||
this.ppComponents = this.pCircuit + 24;
|
||||
this.ppMapIsInput = this.pCircuit + 28;
|
||||
this.ppConstants = this.pCircuit + 32;
|
||||
this.ppSignals = this.pCircuit + 36;
|
||||
this.ppInputSignalsToTrigger = this.pCircuit + 40;
|
||||
this.ppSignalsAssigned = this.pCircuit + 44;
|
||||
this.pNPublic = this.pCircuit + 20;
|
||||
this.ppWit2sig = this.pCircuit + 24;
|
||||
this.ppComponents = this.pCircuit + 28;
|
||||
this.ppMapIsInput = this.pCircuit + 32;
|
||||
this.ppConstants = this.pCircuit + 36;
|
||||
this.ppSignals = this.pCircuit + 40;
|
||||
this.ppInputSignalsToTrigger = this.pCircuit + 44;
|
||||
this.ppSignalsAssigned = this.pCircuit + 48;
|
||||
}
|
||||
|
||||
_buildSizes(module) {
|
||||
@@ -985,6 +986,7 @@ class BuilderWasm {
|
||||
module.addData(this.pNInputs, intToBytes32(this.header.NInputs));
|
||||
module.addData(this.pNOutputs, intToBytes32(this.header.NOutputs));
|
||||
module.addData(this.pNVars, intToBytes32(this.header.NVars));
|
||||
module.addData(this.pNPublic, intToBytes32(this.header.NPublic));
|
||||
module.addData(this.ppWit2sig, intToBytes32(this.pWit2sig));
|
||||
module.addData(this.ppComponents, intToBytes32(this.pComponents));
|
||||
module.addData(this.ppMapIsInput, intToBytes32(this.pMapIsInput));
|
||||
|
||||
Reference in New Issue
Block a user