gnark
gnark copied to clipboard
feat: add Poseidon implementation over bn254
Description
This PR adds support for Poseidon hash over the scalar field of BN254, Poseidon has better performance compared to MiMC and is being used in multiple projects.
Fixes #207
Type of change
- [*] New feature (non-breaking change which adds functionality)
- [*] This change requires a documentation update
How has this been tested?
All unit tests have been made according to the code referenced in Poseidon paper page 20 footnote 16.
How has this been benchmarked?
The code hasn't been benchmarked yet.
Checklist:
- [*] I have performed a self-review of my code
- [*] I have commented my code, particularly in hard-to-understand areas
- [*] New and existing unit tests pass locally with my changes
@HSG88 - we have implemented Poseidon2 over all supported curves in https://github.com/Consensys/gnark/pull/1300. Is there still need for the current PR? If not, then I would be inclined to close it for now.