pub struct MerkleTreeVCS<P, D, H, C> { /* private fields */ }
Expand description
VectorCommitScheme
implementation using a binary Merkle tree.
Implementations§
Trait Implementations§
source§impl<P: Clone, D: Clone, H: Clone, C: Clone> Clone for MerkleTreeVCS<P, D, H, C>
impl<P: Clone, D: Clone, H: Clone, C: Clone> Clone for MerkleTreeVCS<P, D, H, C>
source§fn clone(&self) -> MerkleTreeVCS<P, D, H, C>
fn clone(&self) -> MerkleTreeVCS<P, D, H, C>
Returns a copy of the value. Read more
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<P, D, H, C> VectorCommitScheme<P> for MerkleTreeVCS<P, D, H, C>where
P: PackedField + Sync,
D: PackedField + Send + Sync,
H: Hasher<P, Digest = D> + Send,
C: PseudoCompressionFunction<D, 2> + Sync,
impl<P, D, H, C> VectorCommitScheme<P> for MerkleTreeVCS<P, D, H, C>where
P: PackedField + Sync,
D: PackedField + Send + Sync,
H: Hasher<P, Digest = D> + Send,
C: PseudoCompressionFunction<D, 2> + Sync,
type Commitment = MerkleCap<D>
type Committed = MerkleTree<D>
type Proof = Vec<D>
type Error = Error
source§fn vector_len(&self) -> usize
fn vector_len(&self) -> usize
Returns the length of the vectors that can be committed.
source§fn commit_batch(
&self,
vecs: &[impl AsRef<[P]>],
) -> Result<(Self::Commitment, Self::Committed), Self::Error>
fn commit_batch( &self, vecs: &[impl AsRef<[P]>], ) -> Result<(Self::Commitment, Self::Committed), Self::Error>
Commit a batch of vectors.
source§fn prove_batch_opening(
&self,
committed: &Self::Committed,
index: usize,
) -> Result<Self::Proof, Self::Error>
fn prove_batch_opening( &self, committed: &Self::Committed, index: usize, ) -> Result<Self::Proof, Self::Error>
Generate an opening proof for all vectors in a batch commitment at the given index.
source§fn verify_batch_opening(
&self,
commitment: &Self::Commitment,
index: usize,
proof: Self::Proof,
values: impl Iterator<Item = P>,
) -> Result<(), Self::Error>
fn verify_batch_opening( &self, commitment: &Self::Commitment, index: usize, proof: Self::Proof, values: impl Iterator<Item = P>, ) -> Result<(), Self::Error>
Verify an opening proof for all vectors in a batch commitment at the given index.
source§fn proof_size(&self, _n_vecs: usize) -> usize
fn proof_size(&self, _n_vecs: usize) -> usize
Returns the byte-size of a proof.
impl<P: Copy, D: Copy, H: Copy, C: Copy> Copy for MerkleTreeVCS<P, D, H, C>
Auto Trait Implementations§
impl<P, D, H, C> Freeze for MerkleTreeVCS<P, D, H, C>where
C: Freeze,
impl<P, D, H, C> RefUnwindSafe for MerkleTreeVCS<P, D, H, C>
impl<P, D, H, C> Send for MerkleTreeVCS<P, D, H, C>
impl<P, D, H, C> Sync for MerkleTreeVCS<P, D, H, C>
impl<P, D, H, C> Unpin for MerkleTreeVCS<P, D, H, C>
impl<P, D, H, C> UnwindSafe for MerkleTreeVCS<P, D, H, C>
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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