Struct OptimizedMdsMatrices

Source
pub struct OptimizedMdsMatrices<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> {
    pub M_hat: SquareMatrix<STATE_SIZE_MINUS_1, NUM_STATE_SIZE_MINUS_1_ELEMENTS>,
    pub v: Matrix<1, STATE_SIZE_MINUS_1, STATE_SIZE_MINUS_1>,
    pub w: Matrix<STATE_SIZE_MINUS_1, 1, STATE_SIZE_MINUS_1>,
    pub M_prime: SquareMatrix<STATE_SIZE, NUM_MDS_ELEMENTS>,
    pub M_doubleprime: SquareMatrix<STATE_SIZE, NUM_MDS_ELEMENTS>,
    pub M_inverse: SquareMatrix<STATE_SIZE, NUM_MDS_ELEMENTS>,
    pub M_hat_inverse: SquareMatrix<STATE_SIZE_MINUS_1, NUM_STATE_SIZE_MINUS_1_ELEMENTS>,
    pub M_00: Fq,
    pub M_i: Matrix<STATE_SIZE, STATE_SIZE, NUM_MDS_ELEMENTS>,
    pub v_collection: [Matrix<1, STATE_SIZE_MINUS_1, STATE_SIZE_MINUS_1>; N_PARTIAL_ROUNDS],
    pub w_hat_collection: [Matrix<STATE_SIZE_MINUS_1, 1, STATE_SIZE_MINUS_1>; N_PARTIAL_ROUNDS],
}
Expand description

Represents an optimized MDS (maximum distance separable) matrix.

Fields§

§M_hat: SquareMatrix<STATE_SIZE_MINUS_1, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

A (t - 1) x (t - 1) MDS submatrix derived from the MDS matrix.

§v: Matrix<1, STATE_SIZE_MINUS_1, STATE_SIZE_MINUS_1>

A 1 x (t - 1) (row) vector derived from the MDS matrix.

§w: Matrix<STATE_SIZE_MINUS_1, 1, STATE_SIZE_MINUS_1>

A (t - 1) x 1 (column) vector derived from the MDS matrix.

§M_prime: SquareMatrix<STATE_SIZE, NUM_MDS_ELEMENTS>

A matrix formed from Mhat (an MDS submatrix of the MDS matrix).

§M_doubleprime: SquareMatrix<STATE_SIZE, NUM_MDS_ELEMENTS>

A sparse matrix formed from M,

§M_inverse: SquareMatrix<STATE_SIZE, NUM_MDS_ELEMENTS>

The inverse of the t x t MDS matrix (needed to compute round constants).

§M_hat_inverse: SquareMatrix<STATE_SIZE_MINUS_1, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

The inverse of the (t - 1) x (t - 1) Mhat matrix.

§M_00: Fq

Element at M00

§M_i: Matrix<STATE_SIZE, STATE_SIZE, NUM_MDS_ELEMENTS>

M_i

§v_collection: [Matrix<1, STATE_SIZE_MINUS_1, STATE_SIZE_MINUS_1>; N_PARTIAL_ROUNDS]

v_collection: one per partial round.

§w_hat_collection: [Matrix<STATE_SIZE_MINUS_1, 1, STATE_SIZE_MINUS_1>; N_PARTIAL_ROUNDS]

w_hat_collection: one per round

Trait Implementations§

Source§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> Clone for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

Source§

fn clone( &self, ) -> OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> Debug for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> PartialEq for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

Source§

fn eq( &self, other: &OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>, ) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> Eq for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

Source§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> StructuralPartialEq for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

Auto Trait Implementations§

§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> Freeze for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> RefUnwindSafe for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> Send for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> Sync for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> Unpin for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

§

impl<const N_ROUNDS: usize, const N_PARTIAL_ROUNDS: usize, const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize> UnwindSafe for OptimizedMdsMatrices<N_ROUNDS, N_PARTIAL_ROUNDS, STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.