FieldHasher for other hash functions #824
Replies: 2 comments 2 replies
-
Hi, there difference between So, there is a principal difference between conventional hash functions and SNARK-friendly hash functions and there is not a convenient way to transfer one to another (it can be done by defining a 1-1 mapping between bytes and field elements). So I would say there isn't a way to convert BinaryHasher to FieldHasher trivially. But Poseidon hash function is in the family of SNARK-friendly hash functions, so it should by default implement FieldHasher interface anyway. Do you have a particular implementation of Poseidion hash you're interested in? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the detailed explanation. I am able to run my code. |
Beta Was this translation helpful? Give feedback.
-
Hi, I am learning gnark and I was trying to use Poseidon instead of MiMC, which is present in most of the examples. However, I couldn't understand how I could use other hashes inside a circuit. Is there a way to convert a BinaryHasher to a FieldHasher?
Beta Was this translation helpful? Give feedback.
All reactions