Expand description
The Poseidon2 permutation.
This implementation was based upon the following resources:
- https://github.com/HorizenLabs/poseidon2/blob/main/plain_implementations/src/poseidon2/poseidon2.rs
- https://eprint.iacr.org/2023/323.pdf
Structs§
- HLMDS
Mat4 - MDSMat4
- Poseidon2
- The Poseidon2 permutation.
- Poseidon2
External Matrix General - Poseidon2
External MatrixHL
Traits§
- Diffusion
Permutation - MdsLight
Permutation - For the external layers we use a matrix of the form circ(2M_4, M_4, …, M_4) Where M_4 is a 4 x 4 MDS matrix. This leads to a permutation which has slightly weaker properties to MDS
Functions§
- matmul_
internal - Given a vector v compute the matrix vector product (1 + diag(v))state with 1 denoting the constant matrix of ones.
- poseidon2_
round_ numbers_ 128 - Given a field, a width and an D return the number of full and partial rounds needed to achieve 128 bit security.