pub struct ZKWrappedVerifierChannel<'a, F, Channel>where
F: BinaryField,
Channel: MerkleIPVerifierChannel<F, Elem = F>,{ /* private fields */ }Expand description
A verifier channel that wraps a BaseFoldVerifierChannel and an IOPVerifier.
Self::Elem = CircuitElem<F, InstanceGenerator>. F values received or sampled from the inner
channel are written into the InstanceGenerator’s public segment as inout wires (in the same
order the symbolic
IronSpartanBuilderChannel allocates
them); arithmetic over public values produces derived public values, and mixing with a precommit
key (as recv_one arranges via inout - key) yields a value-less private result.
transparent closures supplied to IOPVerifierChannel::verify_oracle_relation must depend
only on public inputs (constants and sampled challenges), never on private ones — that method
panics otherwise.
Implementations§
Source§impl<'a, F, Channel> ZKWrappedVerifierChannel<'a, F, Channel>where
F: BinaryField,
Channel: MerkleIPVerifierChannel<F, Elem = F>,
impl<'a, F, Channel> ZKWrappedVerifierChannel<'a, F, Channel>where
F: BinaryField,
Channel: MerkleIPVerifierChannel<F, Elem = F>,
Sourcepub fn new(
inner_channel: BaseFoldVerifierChannel<'a, F, Channel>,
outer_verifier: &'a IOPVerifier<F>,
outer_layout: Arc<WitnessLayout<F>>,
) -> Result<Self, Error>
pub fn new( inner_channel: BaseFoldVerifierChannel<'a, F, Channel>, outer_verifier: &'a IOPVerifier<F>, outer_layout: Arc<WitnessLayout<F>>, ) -> Result<Self, Error>
Creates a new ZK-wrapped verifier channel.
The outer verifier’s oracle specs are expected to straddle the inner channel specs:
the outer precommit spec is at position 0 (committed before any inner interaction), and
the remaining outer specs (private, mask) form a suffix that will be received after the
inner verification completes. new receives the outer precommit oracle from the inner
channel and stores the handle for use in Self::finish.
outer_layout is the witness layout of the outer constraint system (the same layout the
prover used); it backs the InstanceGenerator that reconstructs the public-input vector.
It is a shared Arc, not a borrow, so the generator is 'static.
Its CircuitElems live in the transparent closures queued onto inner_channel.
The Arc shares the layout the config owns rather than cloning it.
§Panics
Panics if the channel’s oracle specs do not match the expected layout
[outer_precommit, inner..., outer_private, outer_mask].
Sourcepub const fn public_value(
&self,
elem: &CircuitElem<F, InstanceGenerator<F>>,
) -> Option<F>
pub const fn public_value( &self, elem: &CircuitElem<F, InstanceGenerator<F>>, ) -> Option<F>
The value of an element, when the verifier holds it.
A constant, an inout wire, or anything derived from those alone has a value here; an element that reads a precommit wire has none. This is what lets a check over public values run outside the wrapper circuit — the verifier evaluates it directly instead of constraining it.
Sourcepub fn finish(self) -> Result<(), Error>
pub fn finish(self) -> Result<(), Error>
Consumes the channel and runs the outer verifier.
Reads the outer public-input vector [constants | inout | derived] from the
InstanceGenerator and runs IOPVerifier::verify against the inner channel.
Trait Implementations§
Source§impl<'a, F, Channel> IOPVerifierChannel<F> for ZKWrappedVerifierChannel<'a, F, Channel>where
F: BinaryField,
Channel: MerkleIPVerifierChannel<F, Elem = F>,
impl<'a, F, Channel> IOPVerifierChannel<F> for ZKWrappedVerifierChannel<'a, F, Channel>where
F: BinaryField,
Channel: MerkleIPVerifierChannel<F, Elem = F>,
type Oracle = BaseFoldOracle
Source§fn remaining_oracle_specs(&self) -> &[OracleSpec]
fn remaining_oracle_specs(&self) -> &[OracleSpec]
Source§impl<'a, F, Channel> IPVerifierChannel<F> for ZKWrappedVerifierChannel<'a, F, Channel>where
F: BinaryField,
Channel: MerkleIPVerifierChannel<F, Elem = F>,
impl<'a, F, Channel> IPVerifierChannel<F> for ZKWrappedVerifierChannel<'a, F, Channel>where
F: BinaryField,
Channel: MerkleIPVerifierChannel<F, Elem = F>,
Source§type Elem = CircuitElem<F, InstanceGenerator<F>>
type Elem = CircuitElem<F, InstanceGenerator<F>>
Source§fn recv_one(&mut self) -> Result<Self::Elem, Error>
fn recv_one(&mut self) -> Result<Self::Elem, Error>
Source§fn recv_public_claim(&mut self) -> Result<Self::Elem, Error>
fn recv_public_claim(&mut self) -> Result<Self::Elem, Error>
Source§fn observe_one(&mut self, val: F) -> Self::Elem
fn observe_one(&mut self, val: F) -> Self::Elem
Source§fn assert_zero(&mut self, val: Self::Elem) -> Result<(), Error>
fn assert_zero(&mut self, val: Self::Elem) -> Result<(), Error>
Source§fn recv_many(&mut self, n: usize) -> Result<Vec<Self::Elem>, Error>
fn recv_many(&mut self, n: usize) -> Result<Vec<Self::Elem>, Error>
n field elements from the prover.Source§fn recv_array<const N: usize>(&mut self) -> Result<[Self::Elem; N], Error>
fn recv_array<const N: usize>(&mut self) -> Result<[Self::Elem; N], Error>
Source§impl<F, Channel> WordIPVerifierChannel<F> for ZKWrappedVerifierChannel<'_, F, Channel>
impl<F, Channel> WordIPVerifierChannel<F> for ZKWrappedVerifierChannel<'_, F, Channel>
Source§fn observe_words(&mut self, words: &[Word]) -> Vec<Word>
fn observe_words(&mut self, words: &[Word]) -> Vec<Word>
Auto Trait Implementations§
impl<'a, F, Channel> !RefUnwindSafe for ZKWrappedVerifierChannel<'a, F, Channel>
impl<'a, F, Channel> !Send for ZKWrappedVerifierChannel<'a, F, Channel>
impl<'a, F, Channel> !Sync for ZKWrappedVerifierChannel<'a, F, Channel>
impl<'a, F, Channel> !UnwindSafe for ZKWrappedVerifierChannel<'a, F, Channel>
impl<'a, F, Channel> Freeze for ZKWrappedVerifierChannel<'a, F, Channel>
impl<'a, F, Channel> Unpin for ZKWrappedVerifierChannel<'a, F, Channel>where
<F as UnderlierView>::Underlier: Sized,
Channel: Unpin,
<Channel as MerkleIPVerifierChannel<F>>::Commitment: Unpin,
F: Unpin,
impl<'a, F, Channel> UnsafeUnpin for ZKWrappedVerifierChannel<'a, F, Channel>
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
§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