tendermint::merkle

Trait MerkleHash

Source
pub trait MerkleHash {
    // Required methods
    fn empty_hash(&mut self) -> Hash;
    fn leaf_hash(&mut self, bytes: &[u8]) -> Hash;
    fn inner_hash(&mut self, left: Hash, right: Hash) -> Hash;

    // Provided method
    fn hash_byte_vectors(&mut self, byte_vecs: &[impl AsRef<[u8]>]) -> Hash { ... }
}
Expand description

Implementation of Merkle tree hashing for Tendermint.

Required Methods§

Source

fn empty_hash(&mut self) -> Hash

Source

fn leaf_hash(&mut self, bytes: &[u8]) -> Hash

Source

fn inner_hash(&mut self, left: Hash, right: Hash) -> Hash

Provided Methods§

Source

fn hash_byte_vectors(&mut self, byte_vecs: &[impl AsRef<[u8]>]) -> Hash

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<H> MerkleHash for H
where H: Digest<OutputSize = U32> + FixedOutputReset,

Source§

impl<H: Sha256> MerkleHash for NonIncremental<H>