pub trait PermutationParameters {
type F: IsPrimeField + 'static;
Show 12 associated constants and 1 method
const RATE: usize;
const CAPACITY: usize;
const ALPHA: u32;
const N_FULL_ROUNDS: usize;
const N_PARTIAL_ROUNDS: usize;
const MDS_MATRIX: &'static [FE<Self::F>];
const N_MDS_MATRIX_ROWS: usize;
const N_MDS_MATRIX_COLS: usize;
const ROUND_CONSTANTS: &'static [FE<Self::F>];
const N_ROUND_CONSTANTS_ROWS: usize;
const N_ROUND_CONSTANTS_COLS: usize;
const STATE_SIZE: usize = _;
// Provided method
fn mix(state: &mut [FE<Self::F>]) { ... }
}
Expand description
Parameters for Poseidon
MDS constants and rounds constants are stored as references to slices
representing matrices of N_MDS_MATRIX_ROWS * N_MDS_MATRIX_COLS
and
N_ROUND_CONSTANTS_ROWS * N_ROUND_CONSTANTS_COLS
respectively.
We use this representation rather than an array because we can’t use the
associated constants for dimension, requiring many generic parameters
otherwise.
Required Associated Types§
type F: IsPrimeField + 'static
Required Associated Constants§
const RATE: usize
const CAPACITY: usize
const ALPHA: u32
const N_FULL_ROUNDS: usize
const N_PARTIAL_ROUNDS: usize
const MDS_MATRIX: &'static [FE<Self::F>]
const N_MDS_MATRIX_ROWS: usize
const N_MDS_MATRIX_COLS: usize
const ROUND_CONSTANTS: &'static [FE<Self::F>]
const N_ROUND_CONSTANTS_ROWS: usize
const N_ROUND_CONSTANTS_COLS: usize
Provided Associated Constants§
const STATE_SIZE: usize = _
Provided Methods§
sourcefn mix(state: &mut [FE<Self::F>])
fn mix(state: &mut [FE<Self::F>])
This is the mix function that operates with the MDS matrix Round Constants are sometimes picked to simplify this function, so it can be redefined by each set of permutation parameters if a simplification can be made to make it faster. Notice in that case, MDS constants may not be used.
Object Safety§
This trait is not object safe.