Struct merkle::Proof
[−]
[src]
pub struct Proof<D, T> {
pub digest: D,
pub root_hash: Vec<u8>,
pub lemma: Lemma,
pub value: T,
}An inclusion proof represent the fact that a value is a member
of a MerkleTree with root hash root_hash, and hash function digest.
Fields
digest: D
The hash function used in the original MerkleTree
root_hash: Vec<u8>
The hash of the root of the original MerkleTree
lemma: Lemma
The first Lemma of the Proof
value: T
The value concerned by this Proof
Methods
impl<D, T> Proof<D, T>[src]
fn new(digest: D, root_hash: Vec<u8>, lemma: Lemma, value: T) -> Self
Constructs a new Proof
fn validate(&self, root_hash: &[u8]) -> bool where D: Digest + Clone
Checks whether this inclusion proof is well-formed,
and whether its root hash matches the given root_hash.