Struct winter_prover::proof::Commitments
source · pub struct Commitments(/* private fields */);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§
source§impl Commitments
impl Commitments
sourcepub fn new<H>(
trace_roots: Vec<<H as Hasher>::Digest>,
constraint_root: <H as Hasher>::Digest,
fri_roots: Vec<<H as Hasher>::Digest>
) -> Commitmentswhere
H: Hasher,
pub fn new<H>(
trace_roots: Vec<<H as Hasher>::Digest>,
constraint_root: <H as Hasher>::Digest,
fri_roots: Vec<<H as Hasher>::Digest>
) -> Commitmentswhere
H: Hasher,
Returns a new Commitments struct initialized with the provided commitments.
sourcepub fn add<H>(&mut self, commitment: &<H as Hasher>::Digest)where
H: Hasher,
pub fn add<H>(&mut self, commitment: &<H as Hasher>::Digest)where
H: Hasher,
Adds the specified commitment to the list of commitments.
sourcepub fn parse<H>(
self,
num_trace_segments: usize,
num_fri_layers: usize
) -> Result<(Vec<<H as Hasher>::Digest>, <H as Hasher>::Digest, Vec<<H as Hasher>::Digest>), DeserializationError>where
H: Hasher,
pub fn parse<H>(
self,
num_trace_segments: usize,
num_fri_layers: usize
) -> Result<(Vec<<H as Hasher>::Digest>, <H as Hasher>::Digest, Vec<<H as Hasher>::Digest>), DeserializationError>where
H: Hasher,
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§
source§impl Clone for Commitments
impl Clone for Commitments
source§fn clone(&self) -> Commitments
fn clone(&self) -> Commitments
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Commitments
impl Debug for Commitments
source§impl Default for Commitments
impl Default for Commitments
source§fn default() -> Commitments
fn default() -> Commitments
source§impl Deserializable for Commitments
impl Deserializable for Commitments
source§fn read_from<R>(source: &mut R) -> Result<Commitments, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<Commitments, DeserializationError>where
R: ByteReader,
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.
source§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
source§impl PartialEq for Commitments
impl PartialEq for Commitments
source§fn eq(&self, other: &Commitments) -> bool
fn eq(&self, other: &Commitments) -> bool
self and other values to be equal, and is used
by ==.source§impl Serializable for Commitments
impl Serializable for Commitments
source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Serializes self and writes the resulting bytes into the target.
source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self.