Skip to main content

SumcheckProver

Struct SumcheckProver 

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

Source

pub fn new(poly: ProductPolynomial<F, EF>, sum: EF) -> Self

Creates a prover state from a product polynomial and its claimed sum.

Source

pub const fn claimed_sum(&self) -> EF

Returns the current claimed sum over the remaining unbound variables.

Source

pub fn num_variables(&self) -> usize

Returns the number of remaining (unbound) variables.

Source

pub fn evals(&self) -> Poly<EF>

Extracts the current evaluation polynomial as scalar extension-field elements.

Source

pub fn eval(&self, point: &Point<EF>) -> EF

Evaluates f at a given multilinear point via interpolation.

Source

pub fn weights(&self) -> Poly<EF>

Extracts the current weight polynomial as scalar extension-field elements.

Source

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.

Source

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

Source

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>

Source§

fn clone(&self) -> SumcheckProver<F, EF>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: Debug + Field, EF: Debug + ExtensionField<F>> Debug for SumcheckProver<F, EF>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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>
where EF: Unpin, <EF as ExtensionField<F>>::ExtensionPacking: Unpin,

§

impl<F, EF> UnsafeUnpin for SumcheckProver<F, EF>
where EF: UnsafeUnpin,

§

impl<F, EF> UnwindSafe for SumcheckProver<F, EF>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more