mirror of
https://github.com/arnaucube/circom_tester.git
synced 2026-02-08 03:46:46 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d852d7a8f | ||
|
|
30f12bf326 | ||
|
|
a7db09fba9 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "circom_tester",
|
"name": "circom_tester",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "circom_tester",
|
"name": "circom_tester",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "circom_tester",
|
"name": "circom_tester",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"description": "Tools for testing circom circuits.",
|
"description": "Tools for testing circom circuits.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -80,19 +80,22 @@ class WitnessCalculator {
|
|||||||
this.version = this.instance.exports.getVersion();
|
this.version = this.instance.exports.getVersion();
|
||||||
this.n32 = this.instance.exports.getFieldNumLen32();
|
this.n32 = this.instance.exports.getFieldNumLen32();
|
||||||
|
|
||||||
// Not needed
|
this.instance.exports.getRawPrime();
|
||||||
// this.instance.exports.getRawPrime();
|
const arr = new Array(this.n32);
|
||||||
// const arr = new Array(this.n32);
|
for (let i=0; i<this.n32; i++) {
|
||||||
// for (let i=0; i<this.n32; i++) {
|
arr[this.n32-1-i] = this.instance.exports.readSharedRWMemory(i);
|
||||||
// arr[this.n32-1-i] = this.instance.exports.readSharedRWMemory(i);
|
}
|
||||||
// }
|
this.prime = utils.fromArray32(arr);
|
||||||
// this.prime = utils.fromArray32(arr);
|
|
||||||
|
|
||||||
this.witnessSize = this.instance.exports.getWitnessSize();
|
this.witnessSize = this.instance.exports.getWitnessSize();
|
||||||
|
|
||||||
this.sanityCheck = sanityCheck;
|
this.sanityCheck = sanityCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
circom_version() {
|
||||||
|
return this.instance.exports.getVersion();
|
||||||
|
}
|
||||||
|
|
||||||
async _doCalculateWitness(input, sanityCheck) {
|
async _doCalculateWitness(input, sanityCheck) {
|
||||||
//input is assumed to be a map from signals to arrays of bigints
|
//input is assumed to be a map from signals to arrays of bigints
|
||||||
this.instance.exports.init((this.sanityCheck || sanityCheck) ? 1 : 0);
|
this.instance.exports.init((this.sanityCheck || sanityCheck) ? 1 : 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user