Skip to main content

DuplexSpongeInterface

Trait DuplexSpongeInterface 

Source
pub trait DuplexSpongeInterface {
    // Required methods
    fn new(iv: [u8; 64]) -> Self
       where Self: Sized;
    fn absorb(&mut self, input: &[u8]);
    fn squeeze(&mut self, length: usize) -> Vec<u8> ;
}
Expand description

A trait defining the behavior of a duplex sponge construction.

A duplex sponge allows for:

  • Absorbing input data into the sponge state
  • Squeezing output data from the sponge state

This is the core primitive used for building cryptographic codecs.

Required Methods§

Source

fn new(iv: [u8; 64]) -> Self
where Self: Sized,

Creates a new sponge instance with a given initialization vector (IV).

The IV enables domain separation and reproducibility between parties.

Source

fn absorb(&mut self, input: &[u8])

Absorbs input data into the sponge state.

Source

fn squeeze(&mut self, length: usize) -> Vec<u8>

Squeezes output data from the sponge state.

Implementors§