Skip to main content

Xof

Trait Xof 

Source
pub trait Xof {
    // Required methods
    fn update(&mut self, data: &[u8]);
    fn squeeze(&mut self, out: &mut [u8]);
}
Expand description

Minimal trait for extendable-output functions.

The caller absorbs input incrementally and then squeezes as many output bytes as needed. The first squeeze(...) call transitions the XOF into output mode; later calls continue the same output stream.

Required Methods§

Source

fn update(&mut self, data: &[u8])

Absorb more input bytes.

Source

fn squeeze(&mut self, out: &mut [u8])

Finalize if needed and squeeze more output.

The first call transitions the XOF from absorb mode to squeeze mode. Subsequent calls continue producing output from the same stream. This models sponge-based XOFs such as SHAKE, where the caller may not know the required output length up front.

Implementors§