Absorb

Trait Absorb 

Source
pub trait Absorb {
    // Required methods
    fn to_sponge_bytes(&self, dest: &mut Vec<u8>);
    fn to_sponge_field_elements<F: PrimeField>(&self, dest: &mut Vec<F>);

    // Provided methods
    fn to_sponge_bytes_as_vec(&self) -> Vec<u8>  { ... }
    fn to_sponge_field_elements_as_vec<F: PrimeField>(&self) -> Vec<F> { ... }
    fn batch_to_sponge_bytes(batch: &[Self], dest: &mut Vec<u8>)
       where Self: Sized { ... }
    fn batch_to_sponge_bytes_as_vec(batch: &[Self]) -> Vec<u8> 
       where Self: Sized { ... }
    fn batch_to_sponge_field_elements<F: PrimeField>(
        batch: &[Self],
        dest: &mut Vec<F>,
    )
       where Self: Sized { ... }
    fn batch_to_sponge_field_elements_as_vec<F: PrimeField>(
        batch: &[Self],
    ) -> Vec<F>
       where Self: Sized { ... }
}
Expand description

An interface for objects that can be absorbed by a CryptographicSponge.

Required Methods§

Source

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

Converts the object into a list of bytes that can be absorbed by a CryptographicSponge. Append the list to dest.

Source

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

Converts the object into field elements that can be absorbed by a CryptographicSponge. Append the list to dest

Provided Methods§

Source

fn to_sponge_bytes_as_vec(&self) -> Vec<u8>

Converts the object into a list of bytes that can be absorbed by a CryptographicSponge. Return the list as Vec.

Source

fn to_sponge_field_elements_as_vec<F: PrimeField>(&self) -> Vec<F>

Converts the object into field elements that can be absorbed by a CryptographicSponge. Return the list as Vec

Source

fn batch_to_sponge_bytes(batch: &[Self], dest: &mut Vec<u8>)
where Self: Sized,

Specifies the conversion into a list of bytes for a batch. Append the list to dest.

Source

fn batch_to_sponge_bytes_as_vec(batch: &[Self]) -> Vec<u8>
where Self: Sized,

Specifies the conversion into a list of bytes for a batch. Return the list as Vec.

Source

fn batch_to_sponge_field_elements<F: PrimeField>( batch: &[Self], dest: &mut Vec<F>, )
where Self: Sized,

Specifies the conversion into a list of field elements for a batch. Append the list to dest.

Source

fn batch_to_sponge_field_elements_as_vec<F: PrimeField>( batch: &[Self], ) -> Vec<F>
where Self: Sized,

Specifies the conversion into a list of field elements for a batch. 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 Absorb for bool

Source§

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

Source§

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

Source§

impl Absorb for i8

Source§

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

Source§

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

Source§

impl Absorb for i16

Source§

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

Source§

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

Source§

impl Absorb for i32

Source§

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

Source§

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

Source§

impl Absorb for i64

Source§

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

Source§

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

Source§

impl Absorb for i128

Source§

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

Source§

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

Source§

impl Absorb for isize

Source§

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

Source§

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

Source§

impl Absorb for u8

Source§

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

Source§

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

Source§

fn batch_to_sponge_bytes(batch: &[Self], dest: &mut Vec<u8>)

Source§

fn batch_to_sponge_field_elements<F: PrimeField>( batch: &[Self], dest: &mut Vec<F>, )

Source§

impl Absorb for u16

Source§

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

Source§

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

Source§

impl Absorb for u32

Source§

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

Source§

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

Source§

impl Absorb for u64

Source§

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

Source§

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

Source§

impl Absorb for u128

Source§

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

Source§

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

Source§

impl Absorb for usize

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<A: Absorb> Absorb for Option<A>

Source§

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

Source§

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

Source§

impl<A: Absorb> Absorb for &A

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<CF: PrimeField, P: SWModelParameters<BaseField = CF>> Absorb for GroupAffine<P>

Source§

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

Source§

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

Source§

impl<CF: PrimeField, P: TEModelParameters<BaseField = CF>> Absorb for GroupAffine<P>

Source§

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

Source§

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

Source§

impl<P: Fp256Parameters> Absorb for Fp256<P>

Source§

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

Source§

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

Source§

fn batch_to_sponge_field_elements<F: PrimeField>( batch: &[Self], dest: &mut Vec<F>, )
where Self: Sized,

Source§

impl<P: Fp320Parameters> Absorb for Fp320<P>

Source§

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

Source§

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

Source§

fn batch_to_sponge_field_elements<F: PrimeField>( batch: &[Self], dest: &mut Vec<F>, )
where Self: Sized,

Source§

impl<P: Fp384Parameters> Absorb for Fp384<P>

Source§

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

Source§

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

Source§

fn batch_to_sponge_field_elements<F: PrimeField>( batch: &[Self], dest: &mut Vec<F>, )
where Self: Sized,

Source§

impl<P: Fp768Parameters> Absorb for Fp768<P>

Source§

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

Source§

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

Source§

fn batch_to_sponge_field_elements<F: PrimeField>( batch: &[Self], dest: &mut Vec<F>, )
where Self: Sized,

Source§

impl<P: Fp832Parameters> Absorb for Fp832<P>

Source§

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

Source§

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

Source§

fn batch_to_sponge_field_elements<F: PrimeField>( batch: &[Self], dest: &mut Vec<F>, )
where Self: Sized,

Implementors§