pub struct Commitment<Digest> {
pub root: Digest,
pub depth: usize,
}
Expand description
A Merkle tree commitment.
This struct includes the depth of the tree to guard against attacks that exploit the indistinguishability of leaf digests from inner node digests.
Fields§
§root: Digest
The root digest of the Merkle tree.
depth: usize
The depth of the Merkle tree.
Trait Implementations§
source§impl<F, P, H> CanObserve<Commitment<P>> for FieldChallenger<F, H>where
P: PackedExtension<F, PackedSubfield: PackedFieldIndexable>,
P::Scalar: ExtensionField<F> + BinaryField,
F: BinaryField + Field,
H: FieldChallengerHelper<F>,
impl<F, P, H> CanObserve<Commitment<P>> for FieldChallenger<F, H>where
P: PackedExtension<F, PackedSubfield: PackedFieldIndexable>,
P::Scalar: ExtensionField<F> + BinaryField,
F: BinaryField + Field,
H: FieldChallengerHelper<F>,
fn observe(&mut self, value: Commitment<P>)
fn observe_slice(&mut self, values: &[T])where
T: Clone,
source§impl<Digest: Clone> Clone for Commitment<Digest>
impl<Digest: Clone> Clone for Commitment<Digest>
source§fn clone(&self) -> Commitment<Digest>
fn clone(&self) -> Commitment<Digest>
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<Digest: Debug> Debug for Commitment<Digest>
impl<Digest: Debug> Debug for Commitment<Digest>
source§impl<Digest: PartialEq> PartialEq for Commitment<Digest>
impl<Digest: PartialEq> PartialEq for Commitment<Digest>
impl<Digest: Eq> Eq for Commitment<Digest>
impl<Digest> StructuralPartialEq for Commitment<Digest>
Auto Trait Implementations§
impl<Digest> Freeze for Commitment<Digest>where
Digest: Freeze,
impl<Digest> RefUnwindSafe for Commitment<Digest>where
Digest: RefUnwindSafe,
impl<Digest> Send for Commitment<Digest>where
Digest: Send,
impl<Digest> Sync for Commitment<Digest>where
Digest: Sync,
impl<Digest> Unpin for Commitment<Digest>where
Digest: Unpin,
impl<Digest> UnwindSafe for Commitment<Digest>where
Digest: UnwindSafe,
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