pub struct PoseidonPermutation<const NAME: u32, F: PrimeField, const R: usize, const N: usize> {
    pub full_rounds: usize,
    pub partial_rounds: usize,
    pub alpha: u64,
    pub ark: &'static [[F; N]],
    pub mds: &'static [[F; N]],
    pub state: [F; N],
}Expand description
Poseidon Sponge.
The NAME const is to distinbuish between different bitsizes of the same Field.
For instance Bls12_381 and Bn254 both have field type Fp<MontBackend<FrConfig, 4>, 4> but are different fields.
Fields§
§full_rounds: usizeNumber of rounds in a full-round operation.
partial_rounds: usizeNumber of rounds in a partial-round operation.
alpha: u64Exponent used in S-boxes.
ark: &'static [[F; N]]Additive Round keys. These are added before each MDS matrix application to make it an affine shift.
They are indexed by ark[round_num][state_element_index]
mds: &'static [[F; N]]Maximally Distance Separating (MDS) Matrix.
state: [F; N]Permutation state
Trait Implementations§
Source§impl<const NAME: u32, F: PrimeField, const R: usize, const N: usize> AsMut<[F]> for PoseidonPermutation<NAME, F, R, N>
 
impl<const NAME: u32, F: PrimeField, const R: usize, const N: usize> AsMut<[F]> for PoseidonPermutation<NAME, F, R, N>
Source§impl<const NAME: u32, F: PrimeField, const R: usize, const N: usize> AsRef<[F]> for PoseidonPermutation<NAME, F, R, N>
 
impl<const NAME: u32, F: PrimeField, const R: usize, const N: usize> AsRef<[F]> for PoseidonPermutation<NAME, F, R, N>
Source§impl<const NAME: u32, F: Clone + PrimeField, const R: usize, const N: usize> Clone for PoseidonPermutation<NAME, F, R, N>
 
impl<const NAME: u32, F: Clone + PrimeField, const R: usize, const N: usize> Clone for PoseidonPermutation<NAME, F, R, N>
Source§fn clone(&self) -> PoseidonPermutation<NAME, F, R, N>
 
fn clone(&self) -> PoseidonPermutation<NAME, F, R, N>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl<const NAME: u32, F: PrimeField, const R: usize, const N: usize> Debug for PoseidonPermutation<NAME, F, R, N>
 
impl<const NAME: u32, F: PrimeField, const R: usize, const N: usize> Debug for PoseidonPermutation<NAME, F, R, N>
Source§impl<const NAME: u32, F, const R: usize, const N: usize> Permutation for PoseidonPermutation<NAME, F, R, N>
 
impl<const NAME: u32, F, const R: usize, const N: usize> Permutation for PoseidonPermutation<NAME, F, R, N>
Source§const N: usize = N
 
const N: usize = N
The width of the sponge, equal to rate 
Permutation::R plus capacity.
Cannot be less than 1. Cannot be less than Permutation::R.Auto Trait Implementations§
impl<const NAME: u32, F, const R: usize, const N: usize> Freeze for PoseidonPermutation<NAME, F, R, N>where
    F: Freeze,
impl<const NAME: u32, F, const R: usize, const N: usize> RefUnwindSafe for PoseidonPermutation<NAME, F, R, N>where
    F: RefUnwindSafe,
impl<const NAME: u32, F, const R: usize, const N: usize> Send for PoseidonPermutation<NAME, F, R, N>
impl<const NAME: u32, F, const R: usize, const N: usize> Sync for PoseidonPermutation<NAME, F, R, N>
impl<const NAME: u32, F, const R: usize, const N: usize> Unpin for PoseidonPermutation<NAME, F, R, N>where
    F: Unpin,
impl<const NAME: u32, F, const R: usize, const N: usize> UnwindSafe for PoseidonPermutation<NAME, F, R, N>where
    F: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more