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 typeP: The packed field type withScalar = FNTT: The additive NTT for Reed-Solomon encodingChannel: The Merkle channel carrying all prover interactionA: The allocator the queued messages are drawn from, and the oneSelf::finishruns 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,
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,
Sourcepub fn new(
channel: Channel,
ntt: &'a NTT,
oracle_specs: Vec<OracleSpec>,
fri_params: FRIParams<F>,
rng: impl CryptoRng,
alloc: A,
) -> Self
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.
Sourcepub fn finish(self)
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,
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,
type Oracle = BaseFoldOracle
Source§fn remaining_oracle_specs(&self) -> &[OracleSpec]
fn remaining_oracle_specs(&self) -> &[OracleSpec]
Source§fn send_oracle(&mut self, buffer: FieldSlice<'_, P>) -> Self::Oracle
fn send_oracle(&mut self, buffer: FieldSlice<'_, P>) -> Self::Oracle
Source§fn prove_oracle_relation(
&mut self,
oracle: Self::Oracle,
transparent: StructuredBuffer<P, A::Vec<P>>,
claim: P::Scalar,
)
fn prove_oracle_relation( &mut self, oracle: Self::Oracle, transparent: StructuredBuffer<P, A::Vec<P>>, claim: P::Scalar, )
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,
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_public_claim(&mut self, elem: F)
fn send_public_claim(&mut self, elem: F)
Source§fn observe_one(&mut self, val: F)
fn observe_one(&mut self, val: F)
Source§fn observe_many(&mut self, vals: &[F])
fn observe_many(&mut self, vals: &[F])
Source§fn sample_many(&mut self, n: usize) -> Vec<F>
fn sample_many(&mut self, n: usize) -> Vec<F>
n random challenges.Source§fn sample_array<const N: usize>(&mut self) -> [F; N]
fn sample_array<const N: usize>(&mut self) -> [F; N]
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,
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
type Word = <Channel as WordIPProverChannel<F>>::Word
Source§fn observe_words(&mut self, words: &[Self::Word])
fn observe_words(&mut self, words: &[Self::Word])
Auto Trait Implementations§
impl<'a, F, P, NTT, Channel, A> Freeze for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>
impl<'a, F, P, NTT, Channel, A> RefUnwindSafe for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>where
<F as UnderlierView>::Underlier: Sized,
Channel: RefUnwindSafe,
A: RefUnwindSafe,
NTT: RefUnwindSafe,
F: RefUnwindSafe,
<Channel as MerkleIPProverChannel<F>>::Commitment: RefUnwindSafe,
<A as Allocator>::Vec<P>: RefUnwindSafe,
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>
impl<'a, F, P, NTT, Channel, A> UnwindSafe for BaseFoldProverChannel<'a, F, P, NTT, Channel, A>where
<F as UnderlierView>::Underlier: Sized,
Channel: UnwindSafe,
A: UnwindSafe,
NTT: RefUnwindSafe,
F: UnwindSafe,
<Channel as MerkleIPProverChannel<F>>::Commitment: UnwindSafe,
<A as Allocator>::Vec<P>: UnwindSafe,
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