pub struct StateMatrix<T> { /* private fields */ }
Expand description
The state of the permutation. Consists of 5x5 lanes.
Indexing is defined as mod 5
.
See section 1.6 of the keccak specification for more details.
Implementations§
Source§impl<T> StateMatrix<T>
impl<T> StateMatrix<T>
Sourcepub fn from_values(v: [T; 25]) -> Self
pub fn from_values(v: [T; 25]) -> Self
Creates a new state matrix from an array of values stored in row-major order.
Sourcepub fn from_fn<F>(f: F) -> Self
pub fn from_fn<F>(f: F) -> Self
Creates a new state matrix from a function that takes a coordinate and returns a value.
Sourcepub fn try_from_fn<F, E>(f: F) -> Result<Self, E>
pub fn try_from_fn<F, E>(f: F) -> Result<Self, E>
Creates a new state matrix from a function that takes a coordinate and returns a value or an error.
Trait Implementations§
Source§impl<T: Clone> Clone for StateMatrix<T>
impl<T: Clone> Clone for StateMatrix<T>
Source§fn clone(&self) -> StateMatrix<T>
fn clone(&self) -> StateMatrix<T>
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<T: Default> Default for StateMatrix<T>
impl<T: Default> Default for StateMatrix<T>
Source§fn default() -> StateMatrix<T>
fn default() -> StateMatrix<T>
Returns the “default value” for a type. Read more
Source§impl<T: PartialEq> PartialEq for StateMatrix<T>
impl<T: PartialEq> PartialEq for StateMatrix<T>
impl<T: Eq> Eq for StateMatrix<T>
impl<T> StructuralPartialEq for StateMatrix<T>
Auto Trait Implementations§
impl<T> Freeze for StateMatrix<T>where
T: Freeze,
impl<T> RefUnwindSafe for StateMatrix<T>where
T: RefUnwindSafe,
impl<T> Send for StateMatrix<T>where
T: Send,
impl<T> Sync for StateMatrix<T>where
T: Sync,
impl<T> Unpin for StateMatrix<T>where
T: Unpin,
impl<T> UnwindSafe for StateMatrix<T>where
T: UnwindSafe,
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