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 Lagrange kernel trace polynomial (if any) at z, z * g, z * g^2, …,
z * g^(2^(v-1)), where
v == log(trace_len) - Evaluations of constraint composition column polynomials at z.
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, H>(
&mut self,
trace_ood_frame: &TraceOodFrame<E>,
) -> <H as Hasher>::Digest
pub fn set_trace_states<E, H>( &mut self, trace_ood_frame: &TraceOodFrame<E>, ) -> <H as Hasher>::Digest
Updates the trace state portion of this out-of-domain frame, and returns the hash of the trace states.
The out-of-domain frame is stored as one vector of interleaved values, one from the current row and the other from the next row. 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, b1, a2, b2, …, an, bn, c1, d1, c2, d2, …, cm, dm]
into Self::trace_states (as byte values).
§Panics
Panics if evaluation frame has already been set.
Sourcepub fn set_constraint_evaluations<E>(&mut self, evaluations: &[E])where
E: FieldElement,
pub fn set_constraint_evaluations<E>(&mut self, evaluations: &[E])where
E: FieldElement,
Updates constraint evaluation portion of this out-of-domain frame.
§Panics
Panics if:
- Constraint evaluations have already been set.
evaluationsis an empty vector.
Sourcepub fn parse<E>(
self,
main_trace_width: usize,
aux_trace_width: usize,
num_evaluations: usize,
) -> Result<(TraceOodFrame<E>, Vec<E>), DeserializationError>where
E: FieldElement,
pub fn parse<E>(
self,
main_trace_width: usize,
aux_trace_width: usize,
num_evaluations: usize,
) -> Result<(TraceOodFrame<E>, Vec<E>), DeserializationError>where
E: FieldElement,
Returns an out-of-domain trace frame and a vector of out-of-domain constraint evaluations
contained in self.
§Panics
Panics if either main_trace_width or num_evaluations are equal to zero.
§Errors
Returns an error if:
- Valid
crate::EvaluationFrames for the specifiedmain_trace_widthandaux_trace_widthcould not be parsed from the internal bytes. - A vector of evaluations specified by
num_evaluationscould 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>(source: &mut R) -> Result<OodFrame, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<OodFrame, DeserializationError>where
R: ByteReader,
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>(&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.
impl Eq for OodFrame
impl StructuralPartialEq for OodFrame
Auto Trait Implementations§
impl Freeze for OodFrame
impl RefUnwindSafe for OodFrame
impl Send for OodFrame
impl Sync for OodFrame
impl Unpin for OodFrame
impl UnwindSafe for OodFrame
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
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)
clone_to_uninit)