Trait halo2_gadgets::primitives::poseidon::Spec
source · [−]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
fn full_rounds() -> usize
fn full_rounds() -> usize
The number of full rounds for this specification.
This must be an even number.
fn partial_rounds() -> usize
fn partial_rounds() -> usize
The number of partial rounds for this specification.
fn secure_mds() -> usize
fn secure_mds() -> usize
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.