pub struct Shake128 { /* private fields */ }Expand description
SHAKE128 extendable-output function (FIPS 202, Section 6.2).
Rate = 168 bytes (1344 bits), capacity = 32 bytes (256 bits).
Implementations§
Source§impl Shake128
impl Shake128
Sourcepub fn finalize_xof(self) -> Shake128Reader
pub fn finalize_xof(self) -> Shake128Reader
Finalizes absorption and transitions to a streaming Shake128Reader.
Finalizes self.sponge in place via &mut, constructs the returned reader directly in
the caller’s return slot, and zeroizes the original self.sponge (state + buffer) on drop.
Sourcepub fn xof_reader_from_chunks(chunks: &[&[u8]]) -> Shake128Reader
pub fn xof_reader_from_chunks(chunks: &[&[u8]]) -> Shake128Reader
Absorbs chunks and returns a finalized Shake128Reader.
Inputs shorter than one rate block (< 168 bytes) absorb directly into an in-place
Keccak state (zeroized on drop) without allocating an intermediate byte buffer.
Sourcepub fn xof(data: &[u8], out: &mut [u8])
pub fn xof(data: &[u8], out: &mut [u8])
Computes SHAKE128(data, out.len() * 8) in one shot, writing into out.
Sourcepub fn finalize_xof_into(&mut self, out: &mut [u8])
pub fn finalize_xof_into(&mut self, out: &mut [u8])
Finalizes absorption in place and squeezes out.len() bytes directly into out.
Unlike Self::finalize_xof, this takes &mut self so the sponge is never copied by
value onto a callee’s stack frame before Drop zeroizes it.
Sourcepub fn xof_chunks(chunks: &[&[u8]], out: &mut [u8])
pub fn xof_chunks(chunks: &[&[u8]], out: &mut [u8])
Computes SHAKE128(chunks[0] || chunks[1] || ..., out.len() * 8) in one shot.