Trait nmt_rs::simple_merkle::tree::MerkleHash
source · pub trait MerkleHash {
type Output: Debug + PartialEq + Eq + Clone + Default + Hash + Ord;
const EMPTY_ROOT: Self::Output;
// Required methods
fn hash_leaf(&self, data: &[u8]) -> Self::Output;
fn hash_nodes(&self, l: &Self::Output, r: &Self::Output) -> Self::Output;
}Expand description
A trait for hashing data into a merkle tree
Required Associated Types§
Required Associated Constants§
sourceconst EMPTY_ROOT: Self::Output
const EMPTY_ROOT: Self::Output
The hash of the empty tree. This is often defined as the hash of the empty string.
Required Methods§
sourcefn hash_leaf(&self, data: &[u8]) -> Self::Output
fn hash_leaf(&self, data: &[u8]) -> Self::Output
Hashes data as a “leaf” of the tree. This operation should be domain separated.
sourcefn hash_nodes(&self, l: &Self::Output, r: &Self::Output) -> Self::Output
fn hash_nodes(&self, l: &Self::Output, r: &Self::Output) -> Self::Output
Hashes two digests into one. This operation should be domain separated.
Object Safety§
This trait is not object safe.