https://github.com/jsign/zig-poseidon
A Zig implementation of Poseidon2 hash function.
https://github.com/jsign/zig-poseidon
ethereum hashing-algorithm zksnark
Last synced: 2 months ago
JSON representation
A Zig implementation of Poseidon2 hash function.
- Host: GitHub
- URL: https://github.com/jsign/zig-poseidon
- Owner: jsign
- License: mit
- Created: 2023-08-26T13:41:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-14T17:11:53.000Z (4 months ago)
- Last Synced: 2025-05-08T01:43:45.704Z (2 months ago)
- Topics: ethereum, hashing-algorithm, zksnark
- Language: Zig
- Homepage:
- Size: 922 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# poseidon
A Zig implementation of the Poseidon2 cryptographic hash function.
## Supported Configurations
Currently, this implementation provides:
- BabyBear finite field with a width of 16 elements
- Generic Montgomery form implementation for finite fields of 31 bits or less
- Compression mode, since it's the recommended mode for Merkle Trees compared to the sponge construction.The generic implementation makes it straightforward to add support for additional 31-bit fields.
## Project Motivation
This repository was created primarily to support the upcoming Ethereum Beam chain. The implementation will be updated to match the required configuration once the specifications are finalized.
With time this repository can keep expaning on features:
- Add support for more finite fields.
- Add support for the sponge construction.
- Add benchmarks and optimizations.## Compatibility
This implementation has been cross-validated against the [reference repository](https://github.com/HorizenLabs/poseidon2) cited in the Poseidon2 paper to ensure correctness.
## License
MIT