Skip to main content

IOPVerifier

Struct IOPVerifier 

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

IOP verifier for a particular constraint system.

This struct encapsulates the constraint system, providing the core verification logic independent of the specific IOP compilation strategy. Most users should use Verifier instead, which wraps this with a BaseFold compiler.

Implementations§

Source§

impl IOPVerifier

Source

pub fn new(constraint_system: ConstraintSystem, log_public_words: usize) -> Self

Constructs an IOP verifier for a constraint system.

The constraint system must already be validated via ConstraintSystem::validate.

§Panics

Panics if the wiring matrix’s addresses do not fit; see WiringInfo::new.

Source

pub const fn constraint_system(&self) -> &ConstraintSystem

Returns the constraint system.

Source

pub fn into_constraint_system(self) -> ConstraintSystem

Consumes the IOP verifier and returns the inner constraint system.

Source

pub const fn wiring(&self) -> &WiringInfo

Returns the wiring matrix, which a wiring claim is settled against.

Source

pub const fn log_public_words(&self) -> usize

Returns log2 of the number of public constants and input/output words.

Source

pub const fn log_witness_elems(&self) -> usize

Returns log2 of the number of field elements in the packed trace.

The trace oracle commits only the witness’s hidden segment; the public segment is a verifier-known polynomial. The shift reduction claims that segment over the shared word-index space, which spans the wider of the two segments, so the claim is over log_segment_words words. The oracle itself holds only the Self::n_witness_elems the hidden words fill, and the ring-switch accounts for the coordinates in between.

§Preconditions
  • the wider segment spans at least one field element’s worth of words, which every system with more than one public or private value satisfies
Source

pub const fn n_witness_elems(&self) -> usize

Returns the number of field elements the committed trace words fill.

Source

pub const fn log_witness_words(&self) -> usize

Returns log2 of the number of words in the committed trace.

Source

pub fn oracle_schedule(&self, is_zk: bool) -> OracleSchedule

Returns the oracle schedule for the IOP channel.

This describes the oracles (the witness) that the prover commits to, grouped into the rounds they are committed in.

is_zk is the protocol-level zero-knowledge flag: in a ZK proof the witness oracle is masked, in a transparent proof it is not. The flag is taken per call so that a non-ZK oracle can still participate in a ZK protocol (e.g. indexed relation openings).

The schedule is derived by running Self::verify against an OracleSetupChannel, which records each oracle received (via recv_oracle) without performing any real verification. This keeps the schedule automatically in lockstep with the recv_oracle calls in verify, rather than duplicating it here.

Source

pub fn verify<Channel>( &self, inout: &[Channel::Word], channel: &mut Channel, ) -> Result<WiringEvalClaim<'_, Channel::Elem>, Error>
where Channel: IOPVerifierChannel<B128> + WordIPVerifierChannel<B128>, Channel::Elem: FieldOps<Scalar = B128> + From<B128>,

Verifies a proof using an IOP channel.

This is the core verification logic, independent of the specific IOP compilation strategy. For most users, Verifier::verify is the simpler interface.

inout is the statement as the channel carries it, which is what WordIPVerifierChannel::observe_words returns: the caller observes the concrete words and passes on what comes back. A channel that carries words as wires introduces them there, so the verification below reads the statement symbolically rather than as fixed data.

The reduction’s wiring evaluation comes back as a WiringEvalClaim rather than being checked here, so the caller chooses how the constraint system is read: by computing the evaluation, or by any other argument that opens the claim.

Source

pub fn verify_statement<Channel>( &self, inout: &[Word], channel: &mut Channel, ) -> Result<(), Error>

Observes the statement, verifies against it, and discharges the wiring claim in the field.

This is the whole verification for a channel that carries field values rather than wires. Observing is done here rather than by the caller. Such a channel has no other use for the concrete words.

Trait Implementations§

Source§

impl Clone for IOPVerifier

Source§

fn clone(&self) -> IOPVerifier

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for IOPVerifier

Source§

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

Formats the value using the given formatter. Read more

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.

§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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