binius_core::protocols::sumcheck::prove

Trait SumcheckProver

source
pub trait SumcheckProver<F: Field> {
    // Required methods
    fn n_vars(&self) -> usize;
    fn execute(&mut self, batch_coeff: F) -> Result<RoundCoeffs<F>, Error>;
    fn fold(&mut self, challenge: F) -> Result<(), Error>;
    fn finish(self) -> Result<Vec<F>, Error>;
}
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 caller will get an error result.

This trait is object-safe.

Required Methods§

source

fn n_vars(&self) -> usize

The number of variables in the multivariate polynomial.

source

fn execute(&mut self, batch_coeff: F) -> Result<RoundCoeffs<F>, Error>

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

The prover message mixes the univariate polynomials of the underlying composites using the powers of batch_coeff.

Let $alpha$ refer to batch_coeff. 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 will be the polynomial

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

source

fn fold(&mut self, challenge: F) -> Result<(), Error>

Folds the sumcheck multilinears with a new verifier challenge.

source

fn finish(self) -> Result<Vec<F>, Error>

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

Implementors§

source§

impl<'a, F, FDomain, P, Composition, M, Backend> SumcheckProver<F> for RegularSumcheckProver<'a, FDomain, P, Composition, M, Backend>
where F: Field + ExtensionField<FDomain>, FDomain: Field, P: PackedField<Scalar = F> + PackedExtension<FDomain>, Composition: CompositionPolyOS<P>, M: MultilinearPoly<P> + Send + Sync, Backend: ComputationBackend,

source§

impl<'a, F, FDomain, PBase, P, CompositionBase, Composition, M, Backend> SumcheckProver<F> for ConcreteProver<'a, FDomain, PBase, P, CompositionBase, Composition, M, Backend>
where F: Field + ExtensionField<PBase::Scalar> + ExtensionField<FDomain>, FDomain: Field, PBase: PackedField<Scalar: ExtensionField<FDomain>> + PackedExtension<FDomain>, P: PackedFieldIndexable<Scalar = F> + PackedExtension<FDomain> + RepackedExtension<PBase>, CompositionBase: CompositionPolyOS<PBase>, Composition: CompositionPolyOS<P>, M: MultilinearPoly<P> + Send + Sync, Backend: ComputationBackend,

source§

impl<'a, F, FDomain, PBase, P, CompositionBase, Composition, M, Backend> SumcheckProver<F> for ZerocheckProver<'a, FDomain, PBase, P, CompositionBase, Composition, M, Backend>
where F: Field + ExtensionField<PBase::Scalar> + ExtensionField<FDomain>, FDomain: Field, PBase: PackedField<Scalar: ExtensionField<FDomain>> + PackedExtension<FDomain>, P: PackedFieldIndexable<Scalar = F> + PackedExtension<FDomain> + RepackedExtension<PBase>, CompositionBase: CompositionPolyOS<PBase>, Composition: CompositionPolyOS<P>, M: MultilinearPoly<P> + Send + Sync, Backend: ComputationBackend,