3 unstable releases
Uses new Rust 2024
| 0.2.1 | Dec 19, 2025 |
|---|---|
| 0.2.0 | Nov 20, 2025 |
| 0.1.0 | Oct 29, 2025 |
#233 in Math
21,167 downloads per month
Used in 16 crates
(7 directly)
110KB
1.5K
SLoC
Poseidon2 permutation methods, based on eprint.iacr.org/2023/323.
This crate provides efficient, pure-Rust, minimal APIs to compute the Poseidon2 permutation (not hash) on all supported state sizes (t2, t3, t4, t8, t12, t16).
Currently, the only supported field is the scalar field of bn254.
Parameters are compatible with the original Poseidon2 parameter generation script.
Examples
let mut state = [...];
poseidon2::bn254::t4::permutation(&state);
poseidon2::bn254::t4::permutation_in_place(&mut state);
This crate is suitable for cryptographic circuits, SNARKs, and low-level integrations requiring only the permutation (not hashing).
Poseidon2
Based on the MIT/Apache2.0 licensed reference implementation of HorizenLabs https://github.com/HorizenLabs/poseidon2. Main changes revolve around removing unneeded dependencies and curves which are not required here.
Dependencies
~2.9–4MB
~80K SLoC