aztec-nr - noir_aztec::protocol::merkle_tree::membership

Function check_membership_with_hasher

pub fn check_membership_with_hasher<let TREE_HEIGHT: u32>(
    leaf: Field,
    membership_witness: MembershipWitness<TREE_HEIGHT>,
    root: Field,
    hasher: fn(Field, Field) -> Field,
) -> bool

Check whether a leaf exists in the tree with the given root. Same as check_membership but uses a custom hasher. membership_witness is a hint to prove that the leaf exists in the tree with the given root.

Returns:

  • bool: true if the leaf exists in the tree, false otherwise.