-
Notifications
You must be signed in to change notification settings - Fork 164
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
Parametrizable mimc endianness #479
Comments
Indeed, making it parametric is an option, but I think it would still be a bit confusing. We have actually stumbled a few times when hashing from bytes to My proposal has been to instead implement a new hash interface which takes as an input But until that as a workaround having either optional endianness or different MiMC constructor seems reasonable. cc @ThomasPiellard and @gbotrel, what do you think? |
Also random question regarding this: would it be cryptographically insecure to consider MiMC as a 253bit (avoid the modulus) block-cipher hash function? If not we could have a sha2-like interface ingesting arbitrary bytes? |
Technically we can do both -- for the "hash interface that takes bytes", add in the constructor an option (retro compatible change) with an enum big / little endian. |
It should indeed be a secure cryptographic hash function. The issue it is not usually used outside of circuits is that it is quite slow. But in circuit due to the algebraic nature it is better than SHA2. The problem with current interface (that MiMC implements |
The gnark API is using little endian by default while big.Int, gnark-crypto and many other API are using big endian. One such API is the MiMC hasher that assumes input blocks are big endian encoded. As we already
fr.LittleEndian
andfr.BigEndian
, it would be great to be able to chose between both when constructing the hasher.The text was updated successfully, but these errors were encountered: