referrerpolicy=no-referrer-when-downgrade

Function binary_merkle_tree::verify_proof

source ·
pub fn verify_proof<'a, H, P, L>(
    root: &'a H::Out,
    proof: P,
    number_of_leaves: u32,
    leaf_index: u32,
    leaf: L,
) -> bool
where H: Hasher, H::Out: PartialEq + AsRef<[u8]>, P: IntoIterator<Item = H::Out>, L: Into<Leaf<'a, H::Out>>,
Expand description

Verify Merkle Proof correctness versus given root hash.

The proof is NOT expected to contain leaf hash as the first element, but only all adjacent nodes required to eventually by process of concatenating and hashing end up with given root hash.

The proof must not contain the root hash.