Description
I am trying to use the EdDSAMiMCVerifier() in circomlib/circuits/eddsamimc.circom to do a proof on digital signature. My test case is pretty basic:
-
Ran https://github.com/iden3/circomlib/blob/master/test/eddsamimc.js and obtained all the input values, this is what I got:
{ "Ax":13277427435165878497778222415993513565335242147425444199013288855685581939618, "Ay":13622229784656158136036771217484571176836296686641868549125388198837476602820, "R8x":11220723668893468001994760120794694848178115379170651044669708829805665054484, "R8y":2367470421002446880004241260470975644531657398480773647535134774673409612366, "S":1701898193987160140374512573986329501685719384866194117894109500242212188181, "M":1234 }
-
Used this as the input.json.
-
My test circom looks like this:
pragma circom 2.1.9;
include "comparators.circom";
include "eddsamimc.circom";
template signature_verifier() {
signal input Ax;
signal input Ay;
signal input R8x;
signal input R8y;
signal input S;
signal input M;
log("Ax: ", Ax);
log("Ay: ", Ay);
log("S: ", S);
log("R8x: ", R8x);
log("R8y: ", R8y);
log("M: ", M);
component verifier = EdDSAMiMCVerifier();
verifier.enabled <== 1;
verifier.R8x <== R8x;
verifier.R8y <== R8y;
verifier.S <== S;
verifier.M <== M;
verifier.Ax <== Ax;
verifier.Ay <== Ay;
}
component main {public [Ax, Ay, M] } = signature_verifier();
-
Ran
circom -l ${circomlib_root}/circuits --r1cs --wasm --sym
and generated the _js source directory and other artifacts. -
cd to the _js source directory and ran:
node generate_witness.js exp_signature_proof.wasm input.json witness.wtns
- It failed with an assert error:
Error: Error: Assert Failed. Error in template ForceEqualIfEnabled_26 line: 56 Error in template EdDSAMiMCVerifier_27 line: 135 Error in template signature_verifier_28 line: 28
- Closer examination and noticed that the input values, when received in the signature_verifier() circuit, do not match with the values on input.json:
Ax: 13277427435165879229127886795061058173277359451067951153471836827297979039744 Ay: 13622229784656157736784627256215896066545076058497269563957821995114389569536 S: 1701898193987160122448868197294832073576701317149831509042190124625776607232 R8x: 11220723668893467327474997906289419325118072120038265370896252810391917166592 R8y: 2367470421002446701858687564640979405185980659008351169885193098691419832320 M: 1234
Could someone here help me to debug this please? Thank you!