pub struct Shake256 { /* private fields */ }Expand description
SHAKE256 extendable-output function (FIPS 202, Section 6.2).
Rate = 136 bytes (1088 bits), capacity = 64 bytes (512 bits).
Implementations§
Source§impl Shake256
impl Shake256
Sourcepub fn finalize_xof(self) -> Shake256Reader
pub fn finalize_xof(self) -> Shake256Reader
Finalizes absorption and transitions to a streaming Shake256Reader.
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]]) -> Shake256Reader
pub fn xof_reader_from_chunks(chunks: &[&[u8]]) -> Shake256Reader
Absorbs chunks and returns a finalized Shake256Reader.
Inputs shorter than one rate block (< 136 bytes) absorb directly into an in-place
Keccak state (zeroized on drop) without allocating an intermediate byte buffer.
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(data: &[u8], out: &mut [u8])
pub fn xof(data: &[u8], out: &mut [u8])
Computes SHAKE256(data, out.len() * 8) in one shot, writing into out.
Sourcepub fn xof_chunks(chunks: &[&[u8]], out: &mut [u8])
pub fn xof_chunks(chunks: &[&[u8]], out: &mut [u8])
Computes SHAKE256(chunks[0] || chunks[1] || ..., out.len() * 8) in one shot.
Inputs shorter than one rate block (< 136 bytes) absorb directly into an in-place
Keccak state without allocating an intermediate byte buffer or copying the state on return.