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§
sourcefn hash_pair(&self, a: &Digest, b: &Digest) -> Box<Digest>
fn hash_pair(&self, a: &Digest, b: &Digest) -> Box<Digest>
Generate a hash from a pair of Digest.
sourcefn hash_elem_slice(&self, slice: &[F::Elem]) -> Box<Digest>
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.
sourcefn hash_ext_elem_slice(&self, slice: &[F::ExtElem]) -> Box<Digest>
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.