Trait snarkvm_algorithms::traits::merkle_tree::MerkleParameters
source · [−]pub trait MerkleParameters: Clone + Debug + Send + Sync {
type H: CRH;
const DEPTH: usize;
fn setup(message: &str) -> Self;
fn setup_message(&self) -> &str;
fn crh(&self) -> &Self::H;
fn hash_leaf<L: ToBytes>(
&self,
leaf: &L
) -> Result<<Self::H as CRH>::Output, MerkleError> { ... }
fn hash_inner_node(
&self,
left: &<Self::H as CRH>::Output,
right: &<Self::H as CRH>::Output
) -> Result<<Self::H as CRH>::Output, MerkleError> { ... }
fn hash_empty(&self) -> Result<<Self::H as CRH>::Output, MerkleError> { ... }
}
Associated Types
Associated Constants
Required methods
fn setup_message(&self) -> &str
fn setup_message(&self) -> &str
Returns the saved message
from calling the MerkleParameters::setup()
function.
Provided methods
Returns the hash of a given leaf.
Returns the output hash, given a left and right hash value.