openvm_stark_backend::sumcheck

Function prove_batch

Source
pub fn prove_batch<F: Field, O: MultivariatePolyOracle<F>>(
    claims: Vec<F>,
    polys: Vec<O>,
    lambda: F,
    challenger: &mut impl FieldChallenger<F>,
) -> (SumcheckProof<F>, SumcheckArtifacts<F, O>)
Expand description

Performs sum-check on a random linear combinations of multiple multivariate polynomials.

Let the multivariate polynomials be g_0, ..., g_{n-1}. A single sum-check is performed on multivariate polynomial h = g_0 + lambda * g_1 + ... + lambda^(n-1) * g_{n-1}. The g_is do not need to have the same number of variables. g_is with less variables are folded in the latest possible round of the protocol. For instance with g_0(x, y, z) and g_1(x, y) sum-check is performed on h(x, y, z) = g_0(x, y, z) + lambda * g_1(y, z). Claim c_i should equal the claimed sum of g_i(x_0, ..., x_{j-1}) over all (x_0, ..., x_{j-1}) in {0, 1}^j.

The degree of each g_i should not exceed MAX_DEGREE in any variable. The sum-check proof of h, list of challenges (variable assignment) and the constant oracles (i.e. the g_i with all variables fixed to their corresponding challenges) are returned.

Output is of the form: (proof, artifacts).

§Panics

Panics if:

  • No multivariate polynomials are provided.
  • There aren’t the same number of multivariate polynomials and claims.
  • The degree of any multivariate polynomial exceeds MAX_DEGREE in any variable.
  • The round polynomials are inconsistent with their corresponding claimed sum on 0 and 1.