HashFn

Trait 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§