Trait snarkvm_algorithms::traits::merkle_tree::MerkleParameters[][src]

pub trait MerkleParameters: Send + Sync + Clone + Default {
    type H: CRH;

    const DEPTH: usize;

    fn setup<R: Rng>(rng: &mut R) -> Self;
fn crh(&self) -> &Self::H;
fn parameters(&self) -> &<<Self as MerkleParameters>::H as CRH>::Parameters; fn hash_leaf<L: ToBytes>(
        &self,
        leaf: &L,
        buffer: &mut [u8]
    ) -> Result<<Self::H as CRH>::Output, MerkleError> { ... }
fn hash_inner_node(
        &self,
        left: &<Self::H as CRH>::Output,
        right: &<Self::H as CRH>::Output,
        buffer: &mut [u8]
    ) -> Result<<Self::H as CRH>::Output, MerkleError> { ... }
fn hash_empty(&self) -> Result<<Self::H as CRH>::Output, MerkleError> { ... } }

Associated Types

Associated Constants

Required methods

Setup the MerkleParameters

Returns the collision-resistant hash function used by the Merkle tree.

Returns the collision-resistant hash function parameters used by the Merkle tree.

Provided methods

Returns the hash of a given leaf.

Returns the output hash, given a left and right hash value.

Implementors