Compare commits

...

6 Commits

Author SHA1 Message Date
Jordi Baylina
a18b603b22 0.5.3 2020-03-26 22:36:57 +01:00
Jordi Baylina
f261992689 deps and compatible with node10 2020-03-26 22:36:47 +01:00
Jordi Baylina
45e359aa35 0.5.2 2020-03-26 19:05:36 +01:00
Jordi Baylina
da6cff2335 Resolve right path for circom_runtime in tester 2020-03-26 19:05:23 +01:00
Jordi Baylina
38b4a7a8b3 0.5.1 2020-03-26 18:41:05 +01:00
Jordi Baylina
825f31b420 deps and sanitycheck in tester 2020-03-26 18:40:52 +01:00
5 changed files with 17 additions and 14 deletions

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "circom", "name": "circom",
"version": "0.5.0", "version": "0.5.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -221,9 +221,9 @@
"integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII="
}, },
"circom_runtime": { "circom_runtime": {
"version": "0.0.2", "version": "0.0.3",
"resolved": "https://registry.npmjs.org/circom_runtime/-/circom_runtime-0.0.2.tgz", "resolved": "https://registry.npmjs.org/circom_runtime/-/circom_runtime-0.0.3.tgz",
"integrity": "sha512-aJcQucUxrZ31O7JbY14l1oiP6ZlNAtPW+i8/CY4b9GAjgWPjts+D9pxtz/x2yC2Ei+ieaJY7LFjfCKFTOoHGDQ==", "integrity": "sha512-z4ypbs9cTQn7+2FHZNTnccMj6kQCcKT2agYqCrm2kdLBJh9LDoxU1JVu5mSnVuOtgc7BclQ7r0xclG0zP2rxhw==",
"requires": { "requires": {
"big-integer": "^1.6.48", "big-integer": "^1.6.48",
"fnv-plus": "^1.3.1" "fnv-plus": "^1.3.1"

View File

@@ -1,6 +1,6 @@
{ {
"name": "circom", "name": "circom",
"version": "0.5.0", "version": "0.5.3",
"description": "Language to generate logic circuits", "description": "Language to generate logic circuits",
"main": "index.js", "main": "index.js",
"directories": { "directories": {
@@ -31,14 +31,14 @@
"dependencies": { "dependencies": {
"big-integer": "^1.6.32", "big-integer": "^1.6.32",
"chai": "^4.2.0", "chai": "^4.2.0",
"circom_runtime": "0.0.2", "circom_runtime": "0.0.3",
"ffiasm": "0.0.2", "ffiasm": "0.0.2",
"ffjavascript": "0.0.3", "ffjavascript": "0.0.3",
"ffwasm": "0.0.5", "ffwasm": "0.0.6",
"fnv-plus": "^1.3.1", "fnv-plus": "^1.3.1",
"r1csfile": "0.0.2", "r1csfile": "0.0.3",
"tmp-promise": "^2.0.2", "tmp-promise": "^2.0.2",
"wasmbuilder": "0.0.9" "wasmbuilder": "0.0.10"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^6.8.0", "eslint": "^6.8.0",

View File

@@ -52,7 +52,7 @@ async function c_tester(circomFile, _options) {
); );
} else throw("Unsupported platform"); } else throw("Unsupported platform");
const cdir = path.join(__dirname, "..", "..", "node_modules", "circom_runtime", "c"); const cdir = path.join(path.dirname(require.resolve("circom_runtime")), "c");
await exec("g++" + await exec("g++" +
` ${path.join(cdir, "main.cpp")}` + ` ${path.join(cdir, "main.cpp")}` +

View File

@@ -55,9 +55,8 @@ class WasmTester {
await this.dir.cleanup(); await this.dir.cleanup();
} }
async calculateWitness(input) { async calculateWitness(input, sanityCheck) {
return await this.witnessCalculator.calculateWitness(input, sanityCheck);
return await this.witnessCalculator.calculateWitness(input);
} }
async loadSymbols() { async loadSymbols() {

View File

@@ -103,7 +103,11 @@ async function buildR1cs(ctx, fileName) {
async function writeU64(v, pos) { async function writeU64(v, pos) {
const b = Buffer.allocUnsafe(8); const b = Buffer.allocUnsafe(8);
b.writeBigUInt64LE(BigInt(v));
const LSB = v & 0xFFFFFFFF;
const MSB = Math.floor(v / 0x100000000);
b.writeInt32LE(LSB, 0);
b.writeInt32LE(MSB, 4);
await fd.write(b, 0, 8, pos); await fd.write(b, 0, 8, pos);