Crate p3_poseidon2

Source
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§

HLMDSMat4
MDSMat4
Poseidon2
The Poseidon2 permutation.
Poseidon2ExternalMatrixGeneral
Poseidon2ExternalMatrixHL

Traits§

DiffusionPermutation
MdsLightPermutation
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.