pub struct AuthStructIntegrityProof {
pub nd_auth_struct_indices: Vec<u64>,
pub nd_sibling_indices: Vec<(u64, u64)>,
pub nd_siblings: Vec<(Digest, Digest)>,
}Expand description
A witness to facilitate the proving of the authenticity of a Merkle authentication struct.
Fields§
§nd_auth_struct_indices: Vec<u64>§nd_sibling_indices: Vec<(u64, u64)>§nd_siblings: Vec<(Digest, Digest)>Implementations§
Source§impl AuthStructIntegrityProof
impl AuthStructIntegrityProof
Sourcepub fn root_from_authentication_struct(
&self,
tree_height: u32,
auth_struct: Vec<Digest>,
indexed_leafs: Vec<(u64, Digest)>,
) -> Digest
pub fn root_from_authentication_struct( &self, tree_height: u32, auth_struct: Vec<Digest>, indexed_leafs: Vec<(u64, Digest)>, ) -> Digest
Calculate a root from an authentication structure, indexed leafs, and
additional witness data on self. Crashes if the witness data is
incorrect and if the list of indexed leafs is empty.
Sourcepub fn new_from_mmr_membership_proofs(
mmra: &MmrAccumulator,
indexed_mmr_mps: Vec<(u64, Digest, MmrMembershipProof)>,
) -> HashMap<u32, AuthenticatedMerkleAuthStruct>
pub fn new_from_mmr_membership_proofs( mmra: &MmrAccumulator, indexed_mmr_mps: Vec<(u64, Digest, MmrMembershipProof)>, ) -> HashMap<u32, AuthenticatedMerkleAuthStruct>
Return the authentication structure authenticity witness, authentication structure, and the (leaf-index, leaf-digest) pairs from a list of MMR membership proofs. All MMR membership proofs must belong under the same peak, i.e., be part of the same Merkle tree in the list of Merkle trees that the MMR contains.
Panics if the input list of MMR-membership proofs is empty, or if they do not all belong under the same peak.
Sourcepub fn new_from_merkle_tree(
tree: &MerkleTree,
revealed_leaf_indices: Vec<u64>,
) -> AuthenticatedMerkleAuthStruct
pub fn new_from_merkle_tree( tree: &MerkleTree, revealed_leaf_indices: Vec<u64>, ) -> AuthenticatedMerkleAuthStruct
Return the authentication structure witness, authentication structure, and the (leaf-index, leaf-digest) pairs.
Trait Implementations§
Source§impl Clone for AuthStructIntegrityProof
impl Clone for AuthStructIntegrityProof
Auto Trait Implementations§
impl Freeze for AuthStructIntegrityProof
impl RefUnwindSafe for AuthStructIntegrityProof
impl Send for AuthStructIntegrityProof
impl Sync for AuthStructIntegrityProof
impl Unpin for AuthStructIntegrityProof
impl UnsafeUnpin for AuthStructIntegrityProof
impl UnwindSafe for AuthStructIntegrityProof
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more