Poseidon2
Overview
This is Starkom's implementation of the Poseidon2 algebraic hash.
This crate uses version 2 of the permutation. For version 1 see the
starkom-poseidon crate.
The implementation is generic and works on any prime field.
Configurations for the BLS12-381, Goldilocks, and BlueSky prime fields are provided; the BLS12-381 and BlueSky configurations support T=3 and T=4, while the Goldilocks configurations support T=12 and T=16.
[!NOTE] All predefined configurations are gated behind feature flags to avoid including all constants in all builds. The currently defined feature flags are
bls12_381,goldilocks, andbluesky, all disabled by default.
Usage
The following example functions instantiate Poseidon2 with T=3 and T=4 respectively, squeezing a single element from the output. Both use a single element for capacity.
use Scalar;
use starkom_poseidon2;