Struct PoseidonParameters
pub struct PoseidonParameters<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> {
pub M: usize,
pub alpha: Alpha,
pub rounds: RoundNumbers,
pub mds: MdsMatrix<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>,
pub arc: ArcMatrix<NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS>,
pub optimized_arc: OptimizedArcMatrix<NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS>,
pub optimized_mds: OptimizedMdsMatrices<NUM_ROUND_ROWS, NUM_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>,
}
Expand description
A set of Poseidon1 parameters for a given set of input parameters over decaf377::Fq.
The const STATE_SIZE
corresponds to $t$ in the paper, the width of the hash function,
e.g. $t=3$ corresponds to a 2-to-1 hash.
Fields§
§M: usize
Security level.
alpha: Alpha
Exponent of the Sbox, i.e. S-box(x) = x^{\alpha} used in the SubWords
step
rounds: RoundNumbers
Round numbers
mds: MdsMatrix<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>
t x t
MDS matrix used in the MixLayer
step
arc: ArcMatrix<NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS>
num_total_rounds x t
matrix of constants used in the AddRoundConstant
step
optimized_arc: OptimizedArcMatrix<NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS>
Optimized round constants.
optimized_mds: OptimizedMdsMatrices<NUM_ROUND_ROWS, NUM_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>
Optimized MDS matrices.
Trait Implementations§
§impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Clone for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Clone for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
§fn clone(
&self,
) -> PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
fn clone( &self, ) -> PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
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 more§impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Debug for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Debug for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
Auto Trait Implementations§
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Freeze for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> RefUnwindSafe for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Send for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Sync for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Unpin for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> UnwindSafe for PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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