pub trait Spec<F: FieldExt, const T: usize, const RATE: usize>: Debug {
    fn full_rounds() -> usize;
    fn partial_rounds() -> usize;
    fn sbox(val: F) -> F;
    fn secure_mds() -> usize;

    fn constants() -> (Vec<[F; T]>, [[F; T]; T], [[F; T]; T]) { ... }
}
Expand description

A specification for a Poseidon permutation.

Required Methods

The number of full rounds for this specification.

This must be an even number.

The number of partial rounds for this specification.

The S-box for this specification.

Side-loaded index of the first correct and secure MDS that will be generated by the reference implementation.

This is used by the default implementation of Spec::constants. If you are hard-coding the constants, you may leave this unimplemented.

Provided Methods

Generates (round_constants, mds, mds^-1) corresponding to this specification.

Implementors