pub trait DuplexSpongeInterface: Clone {
type U: Unit;
// Required methods
fn absorb(&mut self, input: &[Self::U]) -> &mut Self;
fn squeeze(&mut self, output: &mut [Self::U]) -> &mut Self;
fn ratchet(&mut self) -> &mut Self;
// Provided methods
fn squeeze_array<const LEN: usize>(&mut self) -> [Self::U; LEN] { ... }
fn squeeze_boxed(&mut self, len: usize) -> Box<[Self::U]> { ... }
}Expand description
A DuplexSpongeInterface is an abstract interface for absorbing and squeezing elements implementing Unit.
HAZARD: Don’t implement this trait unless you know what you are doing. Consider using the sponges already provided by this library.
Required Associated Types§
Required Methods§
Sourcefn absorb(&mut self, input: &[Self::U]) -> &mut Self
fn absorb(&mut self, input: &[Self::U]) -> &mut Self
Absorbs new elements in the sponge.
Calls to absorb are meant to be associative: calling this function multiple times is equivalent to calling it once on the concatenated inputs.
Provided Methods§
Sourcefn squeeze_array<const LEN: usize>(&mut self) -> [Self::U; LEN]
fn squeeze_array<const LEN: usize>(&mut self) -> [Self::U; LEN]
Squeeze a fixed-length array of size LEN.
Sourcefn squeeze_boxed(&mut self, len: usize) -> Box<[Self::U]>
fn squeeze_boxed(&mut self, len: usize) -> Box<[Self::U]>
Squeeze len elements into a fresh-allocated array.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.