pub struct BinaryMerkleTreeScheme<T, H: HashSuite> { /* private fields */ }Expand description
A binary Merkle tree vector commitment, as seen by the verifier.
A committed vector is cut into equal-size batches of values. Each batch is hashed into one leaf digest. Pairs of digests are then folded upward until a single root digest remains.
Implementations§
Trait Implementations§
Source§impl<T, H: HashSuite> Clone for BinaryMerkleTreeScheme<T, H>
impl<T, H: HashSuite> Clone for BinaryMerkleTreeScheme<T, H>
Source§impl<T, H: HashSuite> Debug for BinaryMerkleTreeScheme<T, H>
impl<T, H: HashSuite> Debug for BinaryMerkleTreeScheme<T, H>
Source§impl<T, H: HashSuite> Default for BinaryMerkleTreeScheme<T, H>
impl<T, H: HashSuite> Default for BinaryMerkleTreeScheme<T, H>
Source§impl<T, H> MerkleTreeScheme<T> for BinaryMerkleTreeScheme<T, H>where
T: FixedSizeSerializeBytes,
H: HashSuite,
impl<T, H> MerkleTreeScheme<T> for BinaryMerkleTreeScheme<T, H>where
T: FixedSizeSerializeBytes,
H: HashSuite,
Source§type Digest = Array<u8, <<H as HashSuite>::LeafHash as OutputSizeUser>::OutputSize>
type Digest = Array<u8, <<H as HashSuite>::LeafHash as OutputSizeUser>::OutputSize>
The digest of a leaf or an inner node.
Source§fn optimal_verify_layer(&self, n_queries: usize, tree_depth: usize) -> usize
fn optimal_verify_layer(&self, n_queries: usize, tree_depth: usize) -> usize
Returns the optimal layer that the verifier should verify only once. Read more
Source§fn proof_size(&self, len: usize, n_queries: usize, layer_depth: usize) -> usize
fn proof_size(&self, len: usize, n_queries: usize, layer_depth: usize) -> usize
Returns the total byte-size of a proof for multiple opening queries. Read more
Source§fn verify_vector(
&self,
root: &Self::Digest,
data: &[T],
batch_size: usize,
) -> Result<(), Error>
fn verify_vector( &self, root: &Self::Digest, data: &[T], batch_size: usize, ) -> Result<(), Error>
Verify the opening of the full vector. Read more
Auto Trait Implementations§
impl<T, H> Freeze for BinaryMerkleTreeScheme<T, H>
impl<T, H> RefUnwindSafe for BinaryMerkleTreeScheme<T, H>
impl<T, H> Send for BinaryMerkleTreeScheme<T, H>
impl<T, H> Sync for BinaryMerkleTreeScheme<T, H>
impl<T, H> Unpin for BinaryMerkleTreeScheme<T, H>
impl<T, H> UnsafeUnpin for BinaryMerkleTreeScheme<T, H>
impl<T, H> UnwindSafe for BinaryMerkleTreeScheme<T, H>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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