Struct merkle_light::proof::Proof
[−]
[src]
pub struct Proof<T: Eq + Clone + AsRef<[u8]>> { /* fields omitted */ }
Merkle tree inclusion proof for data element, for which item = Leaf(Hash(Data Item)).
Lemma layout:
[ item h1x h2y h3z ... root ]
Proof validation is positioned hash against lemma path to match root hash.
Methods
impl<T: Eq + Clone + AsRef<[u8]>> Proof<T>
[src]
pub fn new(hash: Vec<T>, path: Vec<bool>) -> Proof<T>
[src]
Creates new MT inclusion proof
pub fn item(&self) -> T
[src]
Return proof target leaf
pub fn root(&self) -> T
[src]
Return tree root
pub fn validate<A: Algorithm<T>>(&self) -> bool
[src]
Verifies MT inclusion proof
Trait Implementations
impl<T: Debug + Eq + Clone + AsRef<[u8]>> Debug for Proof<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: Clone + Eq + Clone + AsRef<[u8]>> Clone for Proof<T>
[src]
fn clone(&self) -> Proof<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more