[][src]Struct merkletree::compound_merkle_proof::CompoundMerkleProof

pub struct CompoundMerkleProof<T: Eq + Clone + AsRef<[u8]>, U: Unsigned, N: Unsigned> { /* fields omitted */ }

Compound Merkle Proof.

A compound merkle proof is a type of merkle tree proof.

Compound 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.

Unlike the existing Proof type, this type of proof requires 2 proofs, potentially each of different arity.

Essentially this type of proof consists of an inner proof within a specific sub-tree as well as a proof for the top-layer to the root (a type of small proof not supported by Proof).

Methods

impl<T: Eq + Clone + AsRef<[u8]>, U: Unsigned, N: Unsigned> CompoundMerkleProof<T, U, N>[src]

pub fn new(
    sub_tree_proof: Proof<T, U>,
    lemma: Vec<T>,
    path: Vec<usize>
) -> Result<CompoundMerkleProof<T, U, N>>
[src]

Creates new compound MT inclusion proof

pub fn sub_tree_root(&self) -> T[src]

Return tree root

pub fn root(&self) -> T[src]

Return tree root

pub fn validate<A: Algorithm<T>>(&self) -> bool[src]

Verifies MT inclusion proof

pub fn path(&self) -> &Vec<usize>[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]>, U: Clone + Unsigned, N: Clone + Unsigned> Clone for CompoundMerkleProof<T, U, N>[src]

impl<T: Debug + Eq + Clone + AsRef<[u8]>, U: Debug + Unsigned, N: Debug + Unsigned> Debug for CompoundMerkleProof<T, U, N>[src]

impl<T: Eq + Clone + AsRef<[u8]>, U: Eq + Unsigned, N: Eq + Unsigned> Eq for CompoundMerkleProof<T, U, N>[src]

impl<T: PartialEq + Eq + Clone + AsRef<[u8]>, U: PartialEq + Unsigned, N: PartialEq + Unsigned> PartialEq<CompoundMerkleProof<T, U, N>> for CompoundMerkleProof<T, U, N>[src]

impl<T: Eq + Clone + AsRef<[u8]>, U: Unsigned, N: Unsigned> StructuralEq for CompoundMerkleProof<T, U, N>[src]

impl<T: Eq + Clone + AsRef<[u8]>, U: Unsigned, N: Unsigned> StructuralPartialEq for CompoundMerkleProof<T, U, N>[src]

Auto Trait Implementations

impl<T, U, N> RefUnwindSafe for CompoundMerkleProof<T, U, N> where
    N: RefUnwindSafe,
    T: RefUnwindSafe,
    U: RefUnwindSafe

impl<T, U, N> Send for CompoundMerkleProof<T, U, N> where
    N: Send,
    T: Send,
    U: Send

impl<T, U, N> Sync for CompoundMerkleProof<T, U, N> where
    N: Sync,
    T: Sync,
    U: Sync

impl<T, U, N> Unpin for CompoundMerkleProof<T, U, N> where
    N: Unpin,
    T: Unpin,
    U: Unpin

impl<T, U, N> UnwindSafe for CompoundMerkleProof<T, U, N> where
    N: UnwindSafe,
    T: UnwindSafe,
    U: UnwindSafe

Blanket Implementations

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

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

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

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

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

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

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,