From 756f1f51e58db0b891b971e2fe63991a64fe2760 Mon Sep 17 00:00:00 2001 From: Jordi Baylina Date: Fri, 20 Dec 2019 21:55:07 +0100 Subject: [PATCH] Multithread --- test/circuits/in.json | 3 ++- test/eddsaposeidon.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/test/circuits/in.json b/test/circuits/in.json index ee2ba8c..89d127c 100644 --- a/test/circuits/in.json +++ b/test/circuits/in.json @@ -1 +1,2 @@ -{ "in": ["0", "0"]} +{"enabled":1,"Ax":"13277427435165878497778222415993513565335242147425444199013288855685581939618","Ay":"13622229784656158136036771217484571176836296686641868549125388198837476602820","R8x":"11220723668893468001994760120794694848178115379170651044669708829805665054484","R8y":"2367470421002446880004241260470975644531657398480773647535134774673409612366","S":"1307100909096544936550139783786226891472336052773077686618468233418583414320","M":"1234"} + diff --git a/test/eddsaposeidon.js b/test/eddsaposeidon.js index bcd12e5..3cc2f6e 100644 --- a/test/eddsaposeidon.js +++ b/test/eddsaposeidon.js @@ -2,6 +2,7 @@ const chai = require("chai"); const path = require("path"); const bigInt = require("big-integer"); const tester = require("circom").tester; +const utils = require("../src/utils"); const eddsa = require("../src/eddsa.js"); @@ -29,14 +30,19 @@ describe("EdDSA Poseidon test", function () { assert(eddsa.verifyPoseidon(msg, signature, pubKey)); - const w = await circuit.calculateWitness({ + const input = { enabled: 1, Ax: pubKey[0], Ay: pubKey[1], R8x: signature.R8[0], R8y: signature.R8[1], S: signature.S, - M: msg}); + M: msg + }; + + // console.log(JSON.stringify(utils.stringifyBigInts(input))); + + const w = await circuit.calculateWitness(input); await circuit.checkConstraints(w); });