arnaucube
arnaucube/circom_testerPublic Self-hosted repository
version added
alrubio alberu04@ucm.es
Wed, 06 Oct 2021 13:16:25 +0200
commit

a7db09fba90ed563a67f6ee2335840c4e2abb155

parent

3942e16d848b0ec00c8104d63e1617b09edc2972

1 files changed, 10 insertions(+), 7 deletions(-)

jump to
M wasm/witness_calculator.js → wasm/witness_calculator.js

@@ -80,19 +80,22 @@

this.version = this.instance.exports.getVersion(); this.n32 = this.instance.exports.getFieldNumLen32(); -// Not needed -// this.instance.exports.getRawPrime(); -// const arr = new Array(this.n32); -// for (let i=0; i<this.n32; i++) { -// arr[this.n32-1-i] = this.instance.exports.readSharedRWMemory(i); -// } -// this.prime = utils.fromArray32(arr); + this.instance.exports.getRawPrime(); + const arr = new Array(this.n32); + for (let i=0; i<this.n32; i++) { + arr[this.n32-1-i] = this.instance.exports.readSharedRWMemory(i); + } + this.prime = utils.fromArray32(arr); this.witnessSize = this.instance.exports.getWitnessSize(); this.sanityCheck = sanityCheck; } + circom_version() { + return this.instance.exports.getVersion(); + } + async _doCalculateWitness(input, sanityCheck) { //input is assumed to be a map from signals to arrays of bigints this.instance.exports.init((this.sanityCheck || sanityCheck) ? 1 : 0);