Closed mdj33 closed 2 years ago
is this solidity implementation match to gnark's mimc hash? https://gist.github.com/HarryR/80b5ff2ce13da12edafda6d21c780730
Hi @mdj33 , there is a discrepancy on our end, the comment on our mimc implementation says that it follows the Miyaguchi–Preneel scheme while it's in fact the Matyas–Meyer–Oseas scheme. The mimc encryption function on the other hand is the same (except that we use 5 for the exponent). It will be fixed on our side to follow Miyaguchi–Preneel.
@ThomasPiellard , it is ok. we have modified HarryR's solidity mimc implement to adapt gnark's for the time being.
@ThomasPiellard @gbotrel , BTW, Is there sha256 or keccak256 hash calculating circuit gadgets for gnark? It will save more gas to calculate hash by sha256 instead of mimc on ETH.
No those hash functions are not implemented. It's our plan to add it at some point though. If you plan to add it soon on your side, don't hesitate to open a PR so we can look at it and integrate it in the std/.
it is ok, thanks!
we are constructing a gnark proof system on ethereum. the public input part need be verified by mimc hash on solidity contract as the circuit implemented with gnark. could you tell me if there is corresponding solidiy implement to mimc hash in gnark? many thanks!