Skip to main content

SumcheckProver

Trait SumcheckProver 

Source
pub trait SumcheckProver<F: Field> {
    // Required methods
    fn n_vars(&self) -> usize;
    fn execute(&mut self) -> Vec<RoundCoeffs<F>>;
    fn fold(&mut self, challenge: F);
    fn finish(self) -> Vec<F>;
}
Expand description

A sumcheck prover with a round-by-round execution interface.

Sumcheck prover logic is accessed via a trait because important optimizations are available depending on the structure of the multivariate polynomial that the protocol targets. For example, Gruen24 observes a significant optimization available to the sumcheck prover when the multivariate is the product of a multilinear composite and an equality indicator polynomial, which arises in the zerocheck protocol.

The trait exposes a round-by-round interface so that protocol execution logic that drives the prover can interleave the executions of the interactive protocol, for example in the case of batching several sumcheck protocols.

The caller must make a specific sequence of calls to the provers. For a prover where Self::n_vars is $n$, the caller must call Self::execute and then Self::fold $n$ times, and finally call Self::finish. If the calls aren’t made in that order, the prover will panic.

This trait is not object-safe.

Required Methods§

Source

fn n_vars(&self) -> usize

The number of variables in the remaining multivariate polynomial.

The number of variables decrements after each Self::fold call, as that binds one free variable with a concrete challenge.

Source

fn execute(&mut self) -> Vec<RoundCoeffs<F>>

Computes the prover messages for this round as a univariate polynomial.

If Self::fold has already been called on the prover with the values $r_0$, …, $r_{k-1}$ and the sumcheck prover is proving the sums of the composite polynomials $C_0, …, C_{m-1}$, then the output of this method for low-to-high evaluation order would be:

$$ R_i = \sum_{v \in B_{n-k-1}} C_i(r_0, …, r_{k-1}, X, {v}), i \in [0, …, m-1] $$

For high-to-low evaluation order the variables are specified in reverse order (starting with the highest indexed one) and hypercube sums are performed over the lower indexed variables.

One entry per claim the prover carries.

Source

fn fold(&mut self, challenge: F)

Folds the sumcheck multilinears with a new verifier challenge.

Source

fn finish(self) -> Vec<F>

Finishes the sumcheck proving protocol and returns the evaluations of all multilinears at the challenge point.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<F, L, R> SumcheckProver<F> for Either<L, R>
where F: Field, L: SumcheckProver<F>, R: SumcheckProver<F>,

Source§

fn n_vars(&self) -> usize

Source§

fn execute(&mut self) -> Vec<RoundCoeffs<F>>

Source§

fn fold(&mut self, challenge: F)

Source§

fn finish(self) -> Vec<F>

Implementors§

Source§

impl<'b, F, P, B, Data> SumcheckProver<F> for SelectorMlecheckProver<'b, P, B, Data>
where F: Field, P: PackedField<Scalar = F>, B: Bitwise, Data: BufferData<P>,

Source§

impl<A, F, P, Evaluator> SumcheckProver<F> for SharedSumcheckProver<'_, A, P, Evaluator>
where A: Allocator, F: Field, P: PackedField<Scalar = F>, Evaluator: SumcheckRoundEvaluator<F, P>,

Source§

impl<F: Field, Inner: SumcheckProver<F>> SumcheckProver<F> for PaddedSumcheckDecorator<F, Inner>

Source§

impl<F: Field, InnerProver: MleCheckProver<F>> SumcheckProver<F> for MleToSumCheckDecorator<F, InnerProver>

Source§

impl<F: Field, P: PackedField<Scalar = F>, Data: BufferData<P> + Sync> SumcheckProver<F> for SparseDenseProductSumcheckProver<P, Data>

Source§

impl<F: Field, P: PackedField<Scalar = F>> SumcheckProver<F> for SparseMultiDenseProductSumcheckProver<P>