mimcsponge: makes rounds constant

This commit is contained in:
Kobi Gurkan 2019-11-14 12:54:07 +02:00
parent 50a725c174
commit de9c7dda46
2 changed files with 4 additions and 2 deletions

@ -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;

@ -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];