Skip to main content

BaseFoldProverChannel

Struct BaseFoldProverChannel 

Source
pub struct BaseFoldProverChannel<'a, F, P, NTT, Channel, A>
where F: BinaryField, P: PackedField<Scalar = F>, NTT: AdditiveNTT<Field = F> + Sync, Channel: MerkleIPProverChannel<F>, A: Allocator,
{ /* private fields */ }
Expand description

A prover channel that uses ZK BaseFold for all oracle commitments and openings.

This channel owns an [StdRng] and generates random masks internally during send_oracle. The caller provides only the raw witness buffer (not doubled). The channel handles:

  • Generating a random mask of equal length
  • Interleaving witness and mask for FRI commitment
  • Running ZK BaseFold proofs in Self::finish

§Type Parameters

  • F: The binary field type
  • P: The packed field type with Scalar = F
  • NTT: The additive NTT for Reed-Solomon encoding
  • Channel: The Merkle channel carrying all prover interaction
  • A: The allocator the queued messages are drawn from, and the one Self::finish runs the opening with

Implementations§

Source§

impl<'a, F, P, NTT, Channel, A> 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

pub fn new( channel: Channel, ntt: &'a NTT, oracle_specs: Vec<OracleSpec>, fri_params: FRIParams<F>, rng: impl CryptoRng, alloc: A, ) -> Self

Creates a new BaseFold ZK prover channel over a Merkle channel from precomputed FRI parameters.

The FRI parameters should already account for ZK (log_batch_size = 1, doubled message length).

The RNG seeds the channel’s own generator, whose only output is the ZK masks. A mask is what hides a committed witness at the positions the verifier opens. Hiding is therefore only as strong as this RNG, so it must be a cryptographic one.

Source

pub fn finish(self)

Consumes the channel and proves the single combined opening over all committed oracles.

All oracle relations queued by prove_oracle_relation across every call are processed here in one batch: masking, one batched sumcheck reducing the masked claims to a shared point r, then one combined FRI opening over every committed oracle (in oracle-index order). Mirrors BaseFoldVerifierChannel::finish.

Trait Implementations§

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§

type Oracle = BaseFoldOracle

Source§

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

Returns the specifications for the remaining oracles to be committed. Read more
Source§

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

Commits an oracle to the verifier. Read more
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. Read more
Source§

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

Gives ownership of the oracle buffer to the channel. Read more
Source§

impl<'a, F, P, NTT, Channel, A> IPProverChannel<F> 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§

fn send_one(&mut self, elem: F)

Sends a single field element to the verifier.
Source§

fn send_many(&mut self, elems: &[F])

Sends multiple field elements to the verifier.
Source§

fn send_public_claim(&mut self, elem: F)

Sends a value the verifier could compute for itself, as advice. Read more
Source§

fn observe_one(&mut self, val: F)

Observes a single field element, feeding it into the Fiat-Shamir state.
Source§

fn observe_many(&mut self, vals: &[F])

Observes multiple field elements, feeding them into the Fiat-Shamir state.
Source§

fn sample(&mut self) -> F

Samples a random challenge. Read more
Source§

fn sample_many(&mut self, n: usize) -> Vec<F>

Samples n random challenges.
Source§

fn sample_array<const N: usize>(&mut self) -> [F; N]

Samples a fixed-size array of random challenges.
Source§

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

Source§

type Word = <Channel as WordIPProverChannel<F>>::Word

The word type this channel carries. Read more
Source§

fn observe_words(&mut self, words: &[Self::Word])

Feeds words into the Fiat-Shamir state, each as eight little-endian bytes.
Source§

fn sample_bits(&mut self, bits: usize) -> Self::Word

Samples a uniform word of the given bit width, matching what the verifier samples. Read more

Auto Trait Implementations§

§

impl<'a, F, P, NTT, Channel, A> Freeze for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>
where <F as UnderlierView>::Underlier: Sized, Channel: Freeze, A: Freeze,

§

impl<'a, F, P, NTT, Channel, A> RefUnwindSafe for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>

§

impl<'a, F, P, NTT, Channel, A> Send for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>
where <F as UnderlierView>::Underlier: Sized, Channel: Send, A: Send, <Channel as MerkleIPProverChannel<F>>::Commitment: Send,

§

impl<'a, F, P, NTT, Channel, A> Sync for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>
where <F as UnderlierView>::Underlier: Sized, Channel: Sync, <Channel as MerkleIPProverChannel<F>>::Commitment: Sync, <A as Allocator>::Vec<P>: Sync,

§

impl<'a, F, P, NTT, Channel, A> Unpin for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>
where <F as UnderlierView>::Underlier: Sized, Channel: Unpin, A: Unpin, F: Unpin, <Channel as MerkleIPProverChannel<F>>::Commitment: Unpin, <A as Allocator>::Vec<P>: Unpin,

§

impl<'a, F, P, NTT, Channel, A> UnsafeUnpin for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>
where <F as UnderlierView>::Underlier: Sized, Channel: UnsafeUnpin, A: UnsafeUnpin,

§

impl<'a, F, P, NTT, Channel, A> UnwindSafe for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>

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> 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, 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