Struct winter_prover::proof::Context
source · pub struct Context { /* private fields */ }Expand description
Basic metadata about a specific execution of a computation.
Implementations§
source§impl Context
impl Context
sourcepub fn new<B>(trace_info: &TraceInfo, options: ProofOptions) -> Contextwhere
B: StarkField,
pub fn new<B>(trace_info: &TraceInfo, options: ProofOptions) -> Contextwhere
B: StarkField,
sourcepub fn trace_layout(&self) -> &TraceLayout
pub fn trace_layout(&self) -> &TraceLayout
Returns a layout describing how columns of the execution trace described by this context are arranged into segments.
sourcepub fn trace_length(&self) -> usize
pub fn trace_length(&self) -> usize
Returns execution trace length of the computation described by this context.
sourcepub fn get_trace_info(&self) -> TraceInfo
pub fn get_trace_info(&self) -> TraceInfo
Returns execution trace info for the computation described by this context.
sourcepub fn lde_domain_size(&self) -> usize
pub fn lde_domain_size(&self) -> usize
Returns the size of the LDE domain for the computation described by this context.
sourcepub fn field_modulus_bytes(&self) -> &[u8] ⓘ
pub fn field_modulus_bytes(&self) -> &[u8] ⓘ
Returns modulus of the field for the computation described by this context.
sourcepub fn num_modulus_bits(&self) -> u32
pub fn num_modulus_bits(&self) -> u32
Returns number of bits in the base field modulus for the computation described by this context.
The modulus is assumed to be encoded in little-endian byte order.
sourcepub fn options(&self) -> &ProofOptions
pub fn options(&self) -> &ProofOptions
Returns proof options which were used to a proof in this context.
Trait Implementations§
source§impl Deserializable for Context
impl Deserializable for Context
source§fn read_from<R>(source: &mut R) -> Result<Context, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<Context, DeserializationError>where
R: ByteReader,
Reads proof context from the specified source and returns the result.
§Errors
Returns an error of a valid Context 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 Context
impl PartialEq for Context
source§impl Serializable for Context
impl Serializable for Context
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
source§impl<E> ToElements<E> for Contextwhere
E: StarkField,
impl<E> ToElements<E> for Contextwhere
E: StarkField,
source§fn to_elements(&self) -> Vec<E>
fn to_elements(&self) -> Vec<E>
Converts this Context into a vector of field elements.
The elements are laid out as follows:
- trace layout info [1 or more elements].
- field modulus bytes [2 field elements].
- field extension and FRI parameters [1 element].
- grinding factor [1 element].
- blowup factor [1 element].
- number of queries [1 element].
- trace length [1 element].
- trace metadata [0 or more elements].