AbsorbWithLength

Trait AbsorbWithLength 

Source
pub trait AbsorbWithLength: Absorb {
    // Required method
    fn absorb_length(&self) -> usize;

    // Provided methods
    fn to_sponge_bytes_with_length(&self, dest: &mut Vec<u8>) { ... }
    fn to_sponge_field_elements_with_length<F: PrimeField>(
        &self,
        dest: &mut Vec<F>,
    ) { ... }
}
Expand description

An extension to Absorb that is specific to items with variable length, such as a list.

Required Methods§

Source

fn absorb_length(&self) -> usize

The length of the self being absorbed.

Provided Methods§

Source

fn to_sponge_bytes_with_length(&self, dest: &mut Vec<u8>)

Converts the object into a list of bytes along with its length information that can be absorbed by a CryptographicSponge. Append the list to dest.

Source

fn to_sponge_field_elements_with_length<F: PrimeField>(&self, dest: &mut Vec<F>)

Converts the object into field elements along with its length information that can be absorbed by a CryptographicSponge. Append the list to dest

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.

Implementations on Foreign Types§

Source§

impl<A: Absorb> AbsorbWithLength for &[A]

Source§

impl<A: Absorb> AbsorbWithLength for Vec<A>

Implementors§