Module poseidon2

Module poseidon2 

Source
Expand description

This module contains the Poseidon hash (whitepaper) function implemented as a Sponge Function.

Poseidon permutation here follows referenced in whitepaper original rust implementation with slight improvements.

§Important Usage Notes

This interface provides low-level primitives and does not implement padding or domain separation. Users are responsible for:

  • Padding inputs appropriately
  • Prepending domain separation tags when needed
  • Managing absorb/squeeze transitions correctly
  • Ensuring proper security practices for their specific use case

Modules§

instance
This module contains the poseidon hash instances for some popular finite field instances.
params
This module contains a trait with poseidon hash parameters.

Structs§

Poseidon2
Poseidon2 sponge that can absorb any number of F field elements and be squeezed to a finite number of F field elements.

Enums§

Mode
Determines whether poseidon sponge in absorbing or squeezing state. In squeezing state, sponge can only squeeze elements.