[][src]Struct mohan::merkle::Proof

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

pub fn validate_with_data<A: Algorithm<T>>(
    &self,
    leaf_data: &dyn Hashable<A>
) -> bool
[src]

Verifies MT inclusion proof and that leaf_data is the original leaf data for which proof was generated.

pub fn path(&self) -> &Vec<bool>[src]

Returns the path of this proof.

pub fn lemma(&self) -> &Vec<T>[src]

Returns the lemma of this proof.

Trait Implementations

impl<T: Clone + Eq + AsRef<[u8]>> Clone for Proof<T>[src]

impl<T: Eq + Clone + AsRef<[u8]>> Eq for Proof<T>[src]

impl<T: PartialEq + Eq + Clone + AsRef<[u8]>> PartialEq<Proof<T>> for Proof<T>[src]

impl<T: Debug + Eq + Clone + AsRef<[u8]>> Debug for Proof<T>[src]

Auto Trait Implementations

impl<T> Send for Proof<T> where
    T: Send

impl<T> Sync for Proof<T> where
    T: Sync

impl<T> Unpin for Proof<T> where
    T: Unpin

impl<T> UnwindSafe for Proof<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Proof<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self