anemoi

Trait Sponge

Source
pub trait Sponge<F: Field> {
    type Digest;

    // Required methods
    fn hash(bytes: &[u8]) -> Self::Digest;
    fn hash_field(elems: &[F]) -> Self::Digest;
    fn merge(digests: &[Self::Digest; 2]) -> Self::Digest;
}
Expand description

Trait for implementing a Sponge construction.

Required Associated Types§

Source

type Digest

Specifies a digest type returned by this hasher.

Required Methods§

Source

fn hash(bytes: &[u8]) -> Self::Digest

Returns a hash of the provided sequence of bytes.

Source

fn hash_field(elems: &[F]) -> Self::Digest

Returns a hash of the provided sequence of field elements.

Source

fn merge(digests: &[Self::Digest; 2]) -> Self::Digest

Compresses two given digests into one.

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§