pub trait Hasher<const CHUNK: usize, F: Field> {
// Required method
fn compress(&self, left: &[F; CHUNK], right: &[F; CHUNK]) -> [F; CHUNK];
// Provided methods
fn hash(&self, values: &[F; CHUNK]) -> [F; CHUNK] { ... }
fn merkle_root(&self, values: &[F]) -> [F; CHUNK] { ... }
}
Required Methods§
Sourcefn compress(&self, left: &[F; CHUNK], right: &[F; CHUNK]) -> [F; CHUNK]
fn compress(&self, left: &[F; CHUNK], right: &[F; CHUNK]) -> [F; CHUNK]
Statelessly compresses two chunks of data into a single chunk.
Provided Methods§
fn hash(&self, values: &[F; CHUNK]) -> [F; CHUNK]
Sourcefn merkle_root(&self, values: &[F]) -> [F; CHUNK]
fn merkle_root(&self, values: &[F]) -> [F; CHUNK]
Chunk a list of fields. Use chunks as leaves to computes the root of the Merkle tree. Assumption: the number of public values is a power of two * CHUNK.