pub struct SumcheckProver<F: Field, EF: ExtensionField<F>> { /* private fields */ }Expand description
Sumcheck prover: drives rounds of the quadratic sumcheck protocol.
§Invariant
At every point during the protocol:
sum == sum_{x in {0,1}^n} f(x) * w(x)where n is the number of remaining unbound variables. It decreases by
one per round as variables are bound to verifier challenges.
Implementations§
Source§impl<F: Field, EF: ExtensionField<F>> SumcheckProver<F, EF>
impl<F: Field, EF: ExtensionField<F>> SumcheckProver<F, EF>
Sourcepub fn new(poly: ProductPolynomial<F, EF>, sum: EF) -> Self
pub fn new(poly: ProductPolynomial<F, EF>, sum: EF) -> Self
Creates a prover state from a product polynomial and its claimed sum.
Sourcepub const fn claimed_sum(&self) -> EF
pub const fn claimed_sum(&self) -> EF
Returns the current claimed sum over the remaining unbound variables.
Sourcepub fn num_variables(&self) -> usize
pub fn num_variables(&self) -> usize
Returns the number of remaining (unbound) variables.
Sourcepub fn evals(&self) -> Poly<EF>
pub fn evals(&self) -> Poly<EF>
Extracts the current evaluation polynomial as scalar extension-field elements.
Sourcepub fn eval(&self, point: &Point<EF>) -> EF
pub fn eval(&self, point: &Point<EF>) -> EF
Evaluates f at a given multilinear point via interpolation.
Sourcepub fn weights(&self) -> Poly<EF>
pub fn weights(&self) -> Poly<EF>
Extracts the current weight polynomial as scalar extension-field elements.
Sourcepub fn accumulate_claim(&mut self, weights_delta: &[EF], sum_delta: EF)
pub fn accumulate_claim(&mut self, weights_delta: &[EF], sum_delta: EF)
Folds a dense weight increment and its claim contribution into the prover.
§Invariant
The caller guarantees sum_delta == <evals, weights_delta>, restoring
the running invariant sum == dot_product after the update.
Sourcepub fn compute_sumcheck_polynomials<Challenger>(
&mut self,
sumcheck_data: &mut SumcheckData<F, EF>,
challenger: &mut Challenger,
folding_factor: usize,
pow_bits: usize,
constraint: Option<Constraint<F, EF>>,
) -> Point<EF>where
Challenger: FieldChallenger<F> + GrindingChallenger<Witness = F>,
pub fn compute_sumcheck_polynomials<Challenger>(
&mut self,
sumcheck_data: &mut SumcheckData<F, EF>,
challenger: &mut Challenger,
folding_factor: usize,
pow_bits: usize,
constraint: Option<Constraint<F, EF>>,
) -> Point<EF>where
Challenger: FieldChallenger<F> + GrindingChallenger<Witness = F>,
Runs additional sumcheck rounds, optionally incorporating a new constraint.
§Phases
- Constraint folding (optional): fold an extra constraint into the weight polynomial and update the claimed sum before any rounds.
- Round execution: perform
folding_factorrounds of one-variable-per-round sumcheck; each round emits coefficients, absorbs a challenge, and folds.
§Returns
The verifier challenges sampled during this batch.
§Panics
- Folding factor must not exceed the current number of remaining variables.
Source§impl<F, EF> SumcheckProver<F, EF>where
F: Field,
EF: ExtensionField<F>,
impl<F, EF> SumcheckProver<F, EF>where
F: Field,
EF: ExtensionField<F>,
Sourcepub fn into_zk_sumcheck<Enc, M, R, Ch>(
self,
zk_data: &mut ZkSumcheckData<F, EF>,
encoding: &Enc,
mmcs: &M,
folding_factor: usize,
pow_bits: usize,
aux_claim: EF,
challenger: &mut Ch,
rng: &mut R,
) -> ZkSumcheckHandoff<F, EF, M>where
Enc: ZkEncodingWithRandomness<EF>,
Enc::Codeword: Matrix<EF>,
M: Mmcs<EF>,
R: Rng,
Ch: FieldChallenger<F> + GrindingChallenger<Witness = F> + CanObserve<M::Commitment>,
pub fn into_zk_sumcheck<Enc, M, R, Ch>(
self,
zk_data: &mut ZkSumcheckData<F, EF>,
encoding: &Enc,
mmcs: &M,
folding_factor: usize,
pow_bits: usize,
aux_claim: EF,
challenger: &mut Ch,
rng: &mut R,
) -> ZkSumcheckHandoff<F, EF, M>where
Enc: ZkEncodingWithRandomness<EF>,
Enc::Codeword: Matrix<EF>,
M: Mmcs<EF>,
R: Rng,
Ch: FieldChallenger<F> + GrindingChallenger<Witness = F> + CanObserve<M::Commitment>,
Runs the HVZK sumcheck overlay on an already-derived residual product polynomial.
This is the post-code-switch analogue of ZkPrefixProver::into_sumcheck:
the caller has already reduced the layout-specific opening relation to a
product polynomial, and this method applies Construction 6.3’s mask
transcript to the next batch of sumcheck rounds.
§Joint claims and the auxiliary constant
The committed-sumcheck relation (Definition 5.8 of eprint 2026/391)
pairs the source claim <f, w> with mask-oracle claims <xi_i, u_i>.
- The mask-claim values are prover-only; their total is the auxiliary constant.
- The bound scalar is the joint claim: source claim plus that constant.
- The constant rides the affine chain with a
2^{-j}carry per round:
h_j gains eps * aux * 2^{-j} on its constant slot
=> h_j(0) + h_j(1) gains eps * aux * 2^{-(j-1)}
=> the final residual gains eps * aux * 2^{-k}Downstream reductions must therefore scale the carried mask covectors
by eps * 2^{-k}.
§Eval side
- Only the weight side and the claim are scaled by
eps. - The evaluation side stays the honest folded message.
- An HVZK code-switch can therefore commit it verbatim.
Trait Implementations§
Source§impl<F: Clone + Field, EF: Clone + ExtensionField<F>> Clone for SumcheckProver<F, EF>
impl<F: Clone + Field, EF: Clone + ExtensionField<F>> Clone for SumcheckProver<F, EF>
Source§fn clone(&self) -> SumcheckProver<F, EF>
fn clone(&self) -> SumcheckProver<F, EF>
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<F, EF> Freeze for SumcheckProver<F, EF>where
EF: Freeze,
impl<F, EF> RefUnwindSafe for SumcheckProver<F, EF>
impl<F, EF> Send for SumcheckProver<F, EF>
impl<F, EF> Sync for SumcheckProver<F, EF>
impl<F, EF> Unpin for SumcheckProver<F, EF>
impl<F, EF> UnsafeUnpin for SumcheckProver<F, EF>where
EF: UnsafeUnpin,
impl<F, EF> UnwindSafe for SumcheckProver<F, EF>
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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