Struct OodFrame

Source
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.

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

Source

pub fn set_trace_states<E, H>( &mut self, trace_ood_frame: &TraceOodFrame<E>, ) -> <H as Hasher>::Digest
where E: FieldElement, H: ElementHasher<BaseField = <E as FieldElement>::BaseField>,

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 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.

Source

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.
  • evaluations is an empty vector.
Source

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 specified main_trace_width and aux_trace_width could not be parsed from the internal bytes.
  • A vector of evaluations specified by num_evaluations could not be parsed from the internal bytes.
  • Any unconsumed bytes remained after the parsing was complete.

Trait Implementations§

Source§

impl Clone for OodFrame

Source§

fn clone(&self) -> OodFrame

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OodFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for OodFrame

Source§

fn default() -> OodFrame

Returns the “default value” for a type. Read more
Source§

impl Deserializable for OodFrame

Source§

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>

Attempts to deserialize the provided bytes into Self and returns the result. Read more
Source§

impl PartialEq for OodFrame

Source§

fn eq(&self, other: &OodFrame) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serializable for OodFrame

Source§

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

Returns an estimate of how many bytes are needed to represent self.

Source§

fn to_bytes(&self) -> Vec<u8>

Serializes self into a vector of bytes.
Source§

impl Eq for OodFrame

Source§

impl StructuralPartialEq for OodFrame

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more