pub struct SHAKE<const SZ: usize> { /* private fields */ }Expand description
SHAKE implementation.
The type parameter SZ must be either 128 or 256, for SHAKE128 and
SHAKE256, respectively. An instance is, at any time, in “initial”
or “flipped” state. The instance is created in input mode, and goes
to output mode when flip() is called. In input mode, data can
be injected with the inject() method. In output mode, data can
be extracted with the extract() method. The reset() method sets
back the instance to its starting state (input mode, and empty).
Instances are cloneable, which captures the current engine state.
Implementations§
Source§impl<const SZ: usize> SHAKE<SZ>
impl<const SZ: usize> SHAKE<SZ>
Sourcepub fn inject(&mut self, src: &[u8])
pub fn inject(&mut self, src: &[u8])
Inject some bytes into the engine.
This function can be called repeatedly. If the engine is in output mode, then a panic is triggered.
Sourcepub fn flip(&mut self)
pub fn flip(&mut self)
Flip the engine from input to output mode.
If the engine is already in output mode, then a panic is triggered.
Trait Implementations§
impl<const SZ: usize> Copy for SHAKE<SZ>
Auto Trait Implementations§
impl<const SZ: usize> Freeze for SHAKE<SZ>
impl<const SZ: usize> RefUnwindSafe for SHAKE<SZ>
impl<const SZ: usize> Send for SHAKE<SZ>
impl<const SZ: usize> Sync for SHAKE<SZ>
impl<const SZ: usize> Unpin for SHAKE<SZ>
impl<const SZ: usize> UnwindSafe for SHAKE<SZ>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)