[−][src]Struct merkletree::compound_merkle_proof::CompoundMerkleProof
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]
sub_tree_proof: Proof<T, U>,
lemma: Vec<T>,
path: Vec<usize>
) -> Result<CompoundMerkleProof<T, U, N>>
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]
fn clone(&self) -> CompoundMerkleProof<T, U, N>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn eq(&self, other: &CompoundMerkleProof<T, U, N>) -> bool
[src]
fn ne(&self, other: &CompoundMerkleProof<T, U, N>) -> bool
[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,
N: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U, N> Send for CompoundMerkleProof<T, U, N> where
N: Send,
T: Send,
U: Send,
N: Send,
T: Send,
U: Send,
impl<T, U, N> Sync for CompoundMerkleProof<T, U, N> where
N: Sync,
T: Sync,
U: Sync,
N: Sync,
T: Sync,
U: Sync,
impl<T, U, N> Unpin for CompoundMerkleProof<T, U, N> where
N: Unpin,
T: Unpin,
U: Unpin,
N: Unpin,
T: Unpin,
U: Unpin,
impl<T, U, N> UnwindSafe for CompoundMerkleProof<T, U, N> where
N: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
N: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,