Struct winter_air::proof::Commitments
source · pub struct Commitments(_);Expand description
Commitments made by the prover during commit phase of the protocol.
These commitments include:
- Commitment to the extended execution trace, which may include commitments to one or more execution trace segments.
- Commitment to the evaluations of constraint composition polynomial over LDE domain.
- Commitments to the evaluations of polynomials at all FRI layers.
Internally, the commitments are stored as a sequence of bytes. Thus, to retrieve the commitments, parse() function should be used.
Implementations
sourceimpl Commitments
impl Commitments
sourcepub fn new<H: Hasher>(
trace_roots: Vec<H::Digest>,
constraint_root: H::Digest,
fri_roots: Vec<H::Digest>
) -> Self
pub fn new<H: Hasher>(
trace_roots: Vec<H::Digest>,
constraint_root: H::Digest,
fri_roots: Vec<H::Digest>
) -> Self
Returns a new Commitments struct initialized with the provided commitments.
sourcepub fn add<H: Hasher>(&mut self, commitment: &H::Digest)
pub fn add<H: Hasher>(&mut self, commitment: &H::Digest)
Adds the specified commitment to the list of commitments.
sourcepub fn parse<H: Hasher>(
self,
num_trace_segments: usize,
num_fri_layers: usize
) -> Result<(Vec<H::Digest>, H::Digest, Vec<H::Digest>), DeserializationError>
pub fn parse<H: Hasher>(
self,
num_trace_segments: usize,
num_fri_layers: usize
) -> Result<(Vec<H::Digest>, H::Digest, Vec<H::Digest>), DeserializationError>
Parses the serialized commitments into distinct parts.
The parts are (in the order in which they appear in the tuple):
- Extended execution trace commitments.
- Constraint composition polynomial evaluation commitment.
- FRI layer commitments.
Errors
Returns an error if the bytes stored in self could not be parsed into the requested number of commitments, or if there are any unconsumed bytes remaining after the parsing completes.
Trait Implementations
sourceimpl Clone for Commitments
impl Clone for Commitments
sourcefn clone(&self) -> Commitments
fn clone(&self) -> Commitments
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresourceimpl Debug for Commitments
impl Debug for Commitments
sourceimpl Default for Commitments
impl Default for Commitments
sourcefn default() -> Commitments
fn default() -> Commitments
sourceimpl Deserializable for Commitments
impl Deserializable for Commitments
sourcefn read_from<R: ByteReader>(
source: &mut R
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>(
source: &mut R
) -> Result<Self, DeserializationError>
Reads commitments from the specified source and returns the result.
Errors
Returns an error of a valid Commitments struct could not be read from the specified
source.
sourcefn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError>where
R: ByteReader,
fn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError>where
R: ByteReader,
source, attempts to deserialize these bytes
into a vector with the specified number of Self elements, and returns the result. Read moresourceimpl PartialEq<Commitments> for Commitments
impl PartialEq<Commitments> for Commitments
sourcefn eq(&self, other: &Commitments) -> bool
fn eq(&self, other: &Commitments) -> bool
sourceimpl Serializable for Commitments
impl Serializable for Commitments
sourcefn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes self and writes the resulting bytes into the target.