pub trait Hasher<T> {
    type Digest;

    // Required methods
    fn new() -> Self;
    fn update(&mut self, data: impl AsRef<[T]>);
    fn chain_update(self, data: impl AsRef<[T]>) -> Self;
    fn finalize(self) -> Self::Digest;
    fn finalize_into(self, out: &mut Self::Digest);
    fn finalize_reset(&mut self) -> Self::Digest;
    fn finalize_into_reset(&mut self, out: &mut Self::Digest);
    fn reset(&mut self);
}
Expand description

Trait representing cryptographic hash functions which is generic over the input type.

This interface is largely based on RustCrypto’s Digest trait, except that instead of requiring byte strings as input and byte arrays as output, this is generic over the input values and has a less constrained output digest type.

Required Associated Types§

source

type Digest

The hash function output type.

Required Methods§

source

fn new() -> Self

source

fn update(&mut self, data: impl AsRef<[T]>)

source

fn chain_update(self, data: impl AsRef<[T]>) -> Self

source

fn finalize(self) -> Self::Digest

source

fn finalize_into(self, out: &mut Self::Digest)

source

fn finalize_reset(&mut self) -> Self::Digest

source

fn finalize_into_reset(&mut self, out: &mut Self::Digest)

source

fn reset(&mut self)

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<P, F> Hasher<P> for Groestl256<P, F>
where F: BinaryField + From<AESTowerField8b> + Into<AESTowerField8b>, P: PackedExtension<F, PackedSubfield: PackedFieldIndexable>, P::Scalar: ExtensionField<F>, OptimalUnderlier256b: PackScalar<F> + Divisible<F::Underlier>, Self: UpdateOverSlice<Elem = F>,

§

type Digest = <ScaledUnderlier<M128, 2> as PackScalar<F>>::Packed