Trait risc0_zkp::core::hash::HashFn

source ·
pub trait HashFn<F: Field>: Send + Sync {
    // Required methods
    fn hash_pair(&self, a: &Digest, b: &Digest) -> Box<Digest>;
    fn hash_elem_slice(&self, slice: &[F::Elem]) -> Box<Digest>;
    fn hash_ext_elem_slice(&self, slice: &[F::ExtElem]) -> Box<Digest>;
}
Expand description

A trait that sets the hashes and encodings used by the ZKP.

Required Methods§

source

fn hash_pair(&self, a: &Digest, b: &Digest) -> Box<Digest>

Generate a hash from a pair of Digest.

source

fn hash_elem_slice(&self, slice: &[F::Elem]) -> Box<Digest>

Generate a hash from a slice of field elements. This may be unpadded so this is only safe to used when the size is known.

source

fn hash_ext_elem_slice(&self, slice: &[F::ExtElem]) -> Box<Digest>

Generate a hash from a slice of extension field element. This may be unpadded so this is only safe to used when the size is known.

Implementors§