Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: number of rounds for mimc #320

Merged
merged 2 commits into from
Jan 31, 2023
Merged

fix: number of rounds for mimc #320

merged 2 commits into from
Jan 31, 2023

Conversation

yelhousni
Copy link
Collaborator

No description provided.

@yelhousni
Copy link
Collaborator Author

For bls12-377, I changed it to:

  • permutation exponent e=17 (instead of -1)
  • number of rounds r=62 (log(r)/log(17)

This follows Penumbra reasoning (doc, audit) for the Poseidon hash. Out-circuit x^17 can be done in 4 squaring and 1 multiplication (much faster than an inverse) and in-circuit in 5 R1CS constraints per round (62*5=310), which is faster than BN254 (110*3=330) and BLS12-381 (111*3=333).

Corresponding PR on gnark side: Consensys/gnark#453

@yelhousni yelhousni merged commit b4237f2 into develop Jan 31, 2023
@yelhousni yelhousni deleted the fix/mimc-rounds branch July 5, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants