Skip to main content

IOPProverChannel

Trait IOPProverChannel 

Source
pub trait IOPProverChannel<P: PackedField, A: Allocator>: IPProverChannel<P::Scalar> {
    type Oracle: Clone;

    // Required methods
    fn remaining_oracle_specs(&self) -> &[OracleSpec];
    fn send_oracle(&mut self, buffer: FieldSlice<'_, P>) -> Self::Oracle;
    fn prove_oracle_relation(
        &mut self,
        oracle: Self::Oracle,
        transparent: StructuredBuffer<P, A::Vec<P>>,
        claim: P::Scalar,
    );
    fn finalize_oracle(&mut self, oracle: Self::Oracle, buffer: FieldVec<P, A>);
}
Expand description

Channel for IOP provers that extends the IP prover channel with oracle operations.

In an IOP, the prover can:

  1. Send field elements to the verifier via send_* methods (inherited)
  2. Sample random challenges via sample (inherited)
  3. Commit oracles to the verifier
  4. Respond to oracle queries with opening proofs

§Contract

The caller must call send_oracle() exactly remaining_oracle_specs().len() times before calling prove_oracle_relation(). Each oracle buffer must match the corresponding specification. Every committed oracle must be handed back to the channel exactly once with finalize_oracle().

Required Associated Types§

Required Methods§

Source

fn remaining_oracle_specs(&self) -> &[OracleSpec]

Returns the specifications for the remaining oracles to be committed.

This slice shrinks as oracles are committed via send_oracle().

Source

fn send_oracle(&mut self, buffer: FieldSlice<'_, P>) -> Self::Oracle

Commits an oracle to the verifier.

§Preconditions
  • remaining_oracle_specs() must be non-empty.
  • buffer.log_len() must match the expected length from the next oracle spec.
Source

fn prove_oracle_relation( &mut self, oracle: Self::Oracle, transparent: StructuredBuffer<P, A::Vec<P>>, claim: P::Scalar, )

Generates an opening proof for one oracle linear relation.

The relation asserts that <oracle_poly, transparent> = claim. An oracle may carry any number of relations.

The transparent may be zero outside one aligned block, and say so through its structure. A channel that understands the structure skips the zeros; any other materializes it.

The channel owns the transparent multilinear until the opening runs, so it is drawn from the caller’s allocator A — a pooled buffer stays pooled all the way through the opening.

§Preconditions
  • remaining_oracle_specs() must be empty (all oracles committed).
  • oracle must be a valid handle returned by send_oracle().
  • transparent.log_len() must match the oracle’s message length.
  • The claim must already be bound to the transcript, since the coefficient that batches the queued relations is drawn only after the queue closes.
Source

fn finalize_oracle(&mut self, oracle: Self::Oracle, buffer: FieldVec<P, A>)

Gives ownership of the oracle buffer to the channel.

The Self::send_oracle method takes a borrowed reference to an oracle buffer and returns a handle to it. In order to prove the oracle relations without unnecessarily cloning the buffer, some channel implementations require ownership of the buffer.

§Preconditions
  • oracle must be a valid handle returned by send_oracle(), not already finalized.
  • buffer must equal the buffer previously committed via send_oracle().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, F, P, A, C> IOPProverChannel<P, A> for MergeProverChannel<'a, P, A, C>
where F: Field, P: PackedField<Scalar = F>, A: Allocator, C: IOPProverChannel<P, A>,

Source§

impl<'a, F, P, NTT, Channel, A> IOPProverChannel<P, A> for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>
where F: BinaryField, P: PackedField<Scalar = F>, NTT: AdditiveNTT<Field = F> + Sync, Channel: MerkleIPProverChannel<F>, A: Allocator,

Source§

impl<F, P, Challenger_> IOPProverChannel<P, GlobalAllocator> for NaiveProverChannel<'_, F, Challenger_>
where F: Field, P: PackedField<Scalar = F>, Challenger_: Challenger,