Smart contract supporting MiMC hash in gnark #1252
Replies: 2 comments 4 replies
-
hi @heianqishijueqile , we do have the implementation of mimc on bls12-377 (corresponding to gnark-crypto's implementation) here https://github.com/Consensys/linea-monorepo/blob/main/contracts/contracts/lib/Mimc.sol We unrolled the loop for performances reason, you can adapt the code for the implementation of mimc on other curves (it's the exact same loop, only the counter and the constants differ) |
Beta Was this translation helpful? Give feedback.
-
I have tried to implement MiMC on BN254 using the Consensys implementation on BLS12-377. I changed the header (from bytes to uint256). The version of BLS12-377 works with my test workflow but no the BN254 version. I have just taken the same code, add rounds to fit all the constants of BN254 and changed the field size. Is there another modification to make that i have not done ? |
Beta Was this translation helpful? Give feedback.
-
In Tornado Cash, there is a contract specifically for computing the MiMC hash, which can be used with Circom to create zero-knowledge proofs. If I want to use gnark for MiMC hash zero-knowledge proofs, is there a contract compatible with the MiMC hash algorithm in gnark?
Beta Was this translation helpful? Give feedback.
All reactions