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.