pub trait HashSuite {
type LeafHash: Digest + BlockSizeUser + FixedOutputReset + Send;
type Compression: PseudoCompressionFunction<Output<Self::LeafHash>, 2> + Default;
type ParLeafHash: ParallelDigest<Digest = Self::LeafHash> + Default;
type ParCompression: ParallelPseudoCompression<Output<Self::LeafHash>, 2, Compression = Self::Compression> + Default;
}Expand description
A bundle of hash and compression types used to build and verify a binary Merkle tree.
Most callers want to vary the underlying hash family (SHA-256, etc.) as a single unit
rather than independently picking a leaf hash, a compression function, and their parallel
counterparts. HashSuite bundles the four related types so that user-facing prover and
verifier APIs can take a single H: HashSuite parameter instead of two or three loose hash
trait parameters.
Required Associated Types§
Sourcetype LeafHash: Digest + BlockSizeUser + FixedOutputReset + Send
type LeafHash: Digest + BlockSizeUser + FixedOutputReset + Send
Sequential hash used to compute leaf digests during verification.
Sourcetype Compression: PseudoCompressionFunction<Output<Self::LeafHash>, 2> + Default
type Compression: PseudoCompressionFunction<Output<Self::LeafHash>, 2> + Default
Sequential 2-to-1 compression used to fold inner Merkle nodes during verification.
Sourcetype ParLeafHash: ParallelDigest<Digest = Self::LeafHash> + Default
type ParLeafHash: ParallelDigest<Digest = Self::LeafHash> + Default
Parallel counterpart of Self::LeafHash used during proving.
Sourcetype ParCompression: ParallelPseudoCompression<Output<Self::LeafHash>, 2, Compression = Self::Compression> + Default
type ParCompression: ParallelPseudoCompression<Output<Self::LeafHash>, 2, Compression = Self::Compression> + Default
Parallel counterpart of Self::Compression used during proving.