[−][src]Struct mohan::merkle::Proof
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]
&self,
leaf_data: &dyn Hashable<A>
) -> bool
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,
T: Send,
impl<T> Sync for Proof<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Proof<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Proof<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Proof<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self