winter_prover::proof

Struct Context

Source
pub struct Context { /* private fields */ }
Expand description

Basic metadata about a specific execution of a computation.

Implementations§

Source§

impl Context

Source

pub fn new<B>(trace_info: TraceInfo, options: ProofOptions) -> Context
where B: StarkField,

Creates a new context for a computation described by the specified field, trace info, and proof options.

§Panics

Panics if either trace length or the LDE domain size implied by the trace length and the blowup factor is greater then u32::MAX.

Source

pub fn trace_info(&self) -> &TraceInfo

Returns execution trace info for the computation described by this context.

Source

pub fn lde_domain_size(&self) -> usize

Returns the size of the LDE domain for the computation described by this context.

Source

pub fn field_modulus_bytes(&self) -> &[u8]

Returns modulus of the field for the computation described by this context.

Source

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.

Source

pub fn options(&self) -> &ProofOptions

Returns proof options which were used to a proof in this context.

Trait Implementations§

Source§

impl Clone for Context

Source§

fn clone(&self) -> Context

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 Context

Source§

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

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

impl Deserializable for Context

Source§

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>

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

impl PartialEq for Context

Source§

fn eq(&self, other: &Context) -> 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 Context

Source§

fn write_into<W>(&self, target: &mut W)
where W: ByteWriter,

Serializes self and writes the resulting bytes into the target.

Source§

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

Serializes self into a vector of bytes.
Source§

fn get_size_hint(&self) -> usize

Returns an estimate of how many bytes are needed to represent self. Read more
Source§

impl<E> ToElements<E> for Context
where E: StarkField,

Source§

fn to_elements(&self) -> Vec<E>

Converts this Context into a vector of field elements.

The elements are laid out as follows:

  • trace info [2 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].
Source§

impl Eq for Context

Source§

impl StructuralPartialEq for Context

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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