Skip to main content

HashSuite

Trait HashSuite 

Source
pub trait HashSuite {
    type LeafHash: Digest + BlockSizeUser + FixedOutputReset + Send;
    type Compression: CompressionFunction<Output<Self::LeafHash>, 2> + Default;
}
Expand description

The two hashes a Merkle commitment needs: one for leaves, one for inner nodes.

Verification walks a single path, so both are sequential. Proving folds whole layers at once and needs a batched counterpart for each, which the prover-side crate adds through its own extension of this trait.

Required Associated Types§

Source

type LeafHash: Digest + BlockSizeUser + FixedOutputReset + Send

Sequential hash used to compute leaf digests.

Source

type Compression: CompressionFunction<Output<Self::LeafHash>, 2> + Default

Sequential 2-to-1 compression used to fold inner Merkle nodes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§