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
impl IOPVerifier
Sourcepub fn new(constraint_system: ConstraintSystem, log_public_words: usize) -> Self
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.
Sourcepub const fn constraint_system(&self) -> &ConstraintSystem
pub const fn constraint_system(&self) -> &ConstraintSystem
Returns the constraint system.
Sourcepub fn into_constraint_system(self) -> ConstraintSystem
pub fn into_constraint_system(self) -> ConstraintSystem
Consumes the IOP verifier and returns the inner constraint system.
Sourcepub const fn wiring(&self) -> &WiringInfo
pub const fn wiring(&self) -> &WiringInfo
Returns the wiring matrix, which a wiring claim is settled against.
Sourcepub const fn log_public_words(&self) -> usize
pub const fn log_public_words(&self) -> usize
Returns log2 of the number of public constants and input/output words.
Sourcepub const fn log_witness_elems(&self) -> usize
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
Sourcepub const fn n_witness_elems(&self) -> usize
pub const fn n_witness_elems(&self) -> usize
Returns the number of field elements the committed trace words fill.
Sourcepub const fn log_witness_words(&self) -> usize
pub const fn log_witness_words(&self) -> usize
Returns log2 of the number of words in the committed trace.
Sourcepub fn oracle_schedule(&self, is_zk: bool) -> OracleSchedule
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.
Sourcepub 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>,
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.
Sourcepub fn verify_statement<Channel>(
&self,
inout: &[Word],
channel: &mut Channel,
) -> Result<(), Error>
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
impl Clone for IOPVerifier
Source§fn clone(&self) -> IOPVerifier
fn clone(&self) -> IOPVerifier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for IOPVerifier
impl RefUnwindSafe for IOPVerifier
impl Send for IOPVerifier
impl Sync for IOPVerifier
impl Unpin for IOPVerifier
impl UnsafeUnpin for IOPVerifier
impl UnwindSafe for IOPVerifier
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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