diff --git a/circuits/eddsamimcsponge.circom b/circuits/eddsamimcsponge.circom index af38d57..93405e9 100644 --- a/circuits/eddsamimcsponge.circom +++ b/circuits/eddsamimcsponge.circom @@ -52,7 +52,7 @@ template EdDSAMiMCSpongeVerifier() { // Calculate the h = H(R,A, msg) - component hash = MiMCSponge(5, 220, 1); + component hash = MiMCSponge(5, 1); hash.ins[0] <== R8x; hash.ins[1] <== R8y; hash.ins[2] <== Ax; diff --git a/circuits/mimcsponge.circom b/circuits/mimcsponge.circom index 3e84c46..8ccb329 100644 --- a/circuits/mimcsponge.circom +++ b/circuits/mimcsponge.circom @@ -1,11 +1,13 @@ // implements MiMC-2n/n as hash using a sponge construction. // log_5(21888242871839275222246405745257275088548364400416034343698204186575808495617) ~= 110 // => nRounds should be 220 -template MiMCSponge(nInputs, nRounds, nOutputs) { +template MiMCSponge(nInputs, nOutputs) { signal input ins[nInputs]; signal input k; signal output outs[nOutputs]; + var nRounds = 220; + // S = R||C component S[nInputs + nOutputs - 1];