Trait Sponge

Source
pub trait Sponge:
    Clone
    + Debug
    + Default
    + Send
    + Sync {
    const RATE: usize;

    // Required methods
    fn init() -> Self;
    fn absorb(&mut self, input: [BFieldElement; 10]);
    fn squeeze(&mut self) -> [BFieldElement; 10];

    // Provided method
    fn pad_and_absorb_all(&mut self, input: &[BFieldElement]) { ... }
}
Expand description

A cryptographic sponge. Should only be based on a cryptographic permutation, e.g., Tip5.

Required Associated Constants§

Required Methods§

Source

fn init() -> Self

Source

fn absorb(&mut self, input: [BFieldElement; 10])

Source

fn squeeze(&mut self) -> [BFieldElement; 10]

Provided Methods§

Source

fn pad_and_absorb_all(&mut self, input: &[BFieldElement])

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 Sponge for Tip5

Source§

const RATE: usize = 10usize