Trait Sponge

Source
pub trait Sponge<Input: Field, Digest> {
    // Required methods
    fn new(params: &'static ArithmeticSpongeParams<Input>) -> Self;
    fn absorb(&mut self, x: &[Input]);
    fn squeeze(&mut self) -> Digest;
    fn reset(&mut self);
}
Expand description

Cryptographic sponge interface - for hashing an arbitrary amount of data into one or more field elements

Required Methods§

Source

fn new(params: &'static ArithmeticSpongeParams<Input>) -> Self

Create a new cryptographic sponge using arithmetic sponge params

Source

fn absorb(&mut self, x: &[Input])

Absorb an array of field elements x

Source

fn squeeze(&mut self) -> Digest

Squeeze an output from the sponge

Source

fn reset(&mut self)

Reset the sponge back to its initial state (as if it were just created)

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.

Implementors§

Source§

impl<F: Field, SC: SpongeConstants> Sponge<F, F> for ArithmeticSponge<F, SC>