[][src]Trait snarkvm_models::algorithms::merkle_tree::MerkleParameters

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

    pub const DEPTH: usize;

    pub fn setup<R: Rng>(rng: &mut R) -> Self;
pub fn crh(&self) -> &Self::H;
pub fn parameters(&self) -> &<Self::H as CRH>::Parameters; pub fn hash_leaf<L: ToBytes>(
        &self,
        leaf: &L,
        buffer: &mut [u8]
    ) -> Result<<Self::H as CRH>::Output, MerkleError> { ... }
pub 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> { ... }
pub fn hash_empty(&self) -> Result<<Self::H as CRH>::Output, MerkleError> { ... } }

Associated Types

type H: CRH[src]

Loading content...

Associated Constants

pub const DEPTH: usize[src]

Loading content...

Required methods

pub fn setup<R: Rng>(rng: &mut R) -> Self[src]

Setup the MerkleParameters

pub fn crh(&self) -> &Self::H[src]

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

pub fn parameters(&self) -> &<Self::H as CRH>::Parameters[src]

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

Loading content...

Provided methods

pub fn hash_leaf<L: ToBytes>(
    &self,
    leaf: &L,
    buffer: &mut [u8]
) -> Result<<Self::H as CRH>::Output, MerkleError>
[src]

Returns the hash of a given leaf.

pub 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>
[src]

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

pub fn hash_empty(&self) -> Result<<Self::H as CRH>::Output, MerkleError>[src]

Loading content...

Implementors

Loading content...