pub struct OodFrame { /* private fields */ }Expand description
Trace and constraint polynomial evaluations at an out-of-domain point.
This struct contains the following evaluations:
- Evaluations of all trace polynomials at z.
- Evaluations of all trace polynomials at z * g.
- Evaluations of constraint composition column polynomials at z.
- Evaluations of constraint composition column polynomials at z * g.
where z is an out-of-domain point and g is the generator of the trace domain.
Internally, the evaluations are stored as a sequence of bytes. Thus, to retrieve the evaluations, parse() function should be used.
Implementations§
Source§impl OodFrame
impl OodFrame
Sourcepub fn set_trace_states<E>(&mut self, trace_ood_frame: &TraceOodFrame<E>)where
E: FieldElement,
pub fn set_trace_states<E>(&mut self, trace_ood_frame: &TraceOodFrame<E>)where
E: FieldElement,
Updates the trace state portion of this out-of-domain frame.
The out-of-domain frame is stored as one vector built from the concatenation of values of two vectors, the current row vector and the next row vector. Given the input frame
+—––+—––+—––+—––+—––+—––+—––+—––+ | a1 | a2 | … | an | c1 | c2 | … | cm | +—––+—––+—––+—––+—––+—––+—––+—––+ | b1 | b2 | … | bn | d1 | d2 | … | dm | +—––+—––+—––+—––+—––+—––+—––+—––+
with n being the main trace width and m the auxiliary trace width, the values are stored as
[a1, …, an, c1, …, cm, b1, …, bn, d1, …, dm]
into Self::trace_states (as byte values).
§Panics
Panics if evaluation frame has already been set.
Sourcepub fn set_quotient_states<E>(
&mut self,
quotients_ood_frame: &QuotientOodFrame<E>,
)where
E: FieldElement,
pub fn set_quotient_states<E>(
&mut self,
quotients_ood_frame: &QuotientOodFrame<E>,
)where
E: FieldElement,
Updates constraints composition polynomials (i.e., quotient polynomials) state portion of this out-of-domain frame.
The out-of-domain frame is stored as one vector built from the concatenation of values of two vectors, the current row vector and the next row vector. Given the input frame
+—––+—––+—––+—––+—––+—––+—––+—––+ | a1 | a2 | … | … | … | … | … | an | +—––+—––+—––+—––+—––+—––+—––+—––+ | b1 | b2 | … | … | … | … | … | bn | +—––+—––+—––+—––+—––+—––+—––+—––+
with n being the number of constraints composition polynomials, the values are stored as
[a1, …, an, b1, …, bn]
into Self::quotient_states (as byte values).
§Panics
Panics if:
- Constraint evaluations have already been set.
Sourcepub fn parse<E: FieldElement>(
self,
main_trace_width: usize,
aux_trace_width: usize,
num_quotients: usize,
) -> Result<(TraceOodFrame<E>, QuotientOodFrame<E>), DeserializationError>
pub fn parse<E: FieldElement>( self, main_trace_width: usize, aux_trace_width: usize, num_quotients: usize, ) -> Result<(TraceOodFrame<E>, QuotientOodFrame<E>), DeserializationError>
Returns an out-of-domain trace frame and an out-of-domain constraints evaluations frame.
contained in self.
§Panics
Panics if either main_trace_width or num_evaluations are equal to zero.
§Errors
Returns an error if:
- Valid
TraceOodFrames for the specifiedmain_trace_widthandaux_trace_widthcould not be parsed from the internal bytes. - Valid
QuotientOodFrames for the specifiednum_quotientscould not be parsed from the internal bytes. - Any unconsumed bytes remained after the parsing was complete.
Trait Implementations§
Source§impl Deserializable for OodFrame
impl Deserializable for OodFrame
Source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
Reads a OOD frame from the specified source and returns the result
§Errors
Returns an error of a valid OOD frame 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 Serializable for OodFrame
impl Serializable for OodFrame
Source§fn 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.
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.