pub struct MLSumcheck<F: Field>(/* private fields */);Expand description
Sumcheck for products of multilinear polynomial
Implementations§
Source§impl<F: Field> MLSumcheck<F>
impl<F: Field> MLSumcheck<F>
Sourcepub fn extract_sum(proof: &Proof<F>) -> F
pub fn extract_sum(proof: &Proof<F>) -> F
extract sum from the proof
Sourcepub fn prove(
polynomial: &ListOfProductsOfPolynomials<F>,
) -> Result<Proof<F>, Error>
pub fn prove( polynomial: &ListOfProductsOfPolynomials<F>, ) -> Result<Proof<F>, Error>
generate proof of the sum of polynomial over {0,1}^num_vars
The polynomial is represented by a list of products of polynomials along with its coefficient that is meant to be added together.
This data structure of the polynomial is a list of list of (coefficient, DenseMultilinearExtension).
- Number of products n =
polynomial.products.len(), - Number of multiplicands of ith product m_i =
polynomial.products[i].1.len(), - Coefficient of ith product c_i =
polynomial.products[i].0
The resulting polynomial is
$$\sum_{i=0}^{n}C_i\cdot\prod_{j=0}^{m_i}P_{ij}$$
Sourcepub fn prove_as_subprotocol(
fs_rng: &mut impl FeedableRNG<Error = Error>,
polynomial: &ListOfProductsOfPolynomials<F>,
) -> Result<(Proof<F>, ProverState<F>), Error>
pub fn prove_as_subprotocol( fs_rng: &mut impl FeedableRNG<Error = Error>, polynomial: &ListOfProductsOfPolynomials<F>, ) -> Result<(Proof<F>, ProverState<F>), Error>
This function does the same thing as prove, but it uses a FeedableRNG as the transcript/to generate the
verifier challenges. Additionally, it returns the prover’s state in addition to the proof.
Both of these allow this sumcheck to be better used as a part of a larger protocol.
Sourcepub fn verify(
polynomial_info: &PolynomialInfo,
claimed_sum: F,
proof: &Proof<F>,
) -> Result<SubClaim<F>, Error>
pub fn verify( polynomial_info: &PolynomialInfo, claimed_sum: F, proof: &Proof<F>, ) -> Result<SubClaim<F>, Error>
verify the claimed sum using the proof
Sourcepub fn verify_as_subprotocol(
fs_rng: &mut impl FeedableRNG<Error = Error>,
polynomial_info: &PolynomialInfo,
claimed_sum: F,
proof: &Proof<F>,
) -> Result<SubClaim<F>, Error>
pub fn verify_as_subprotocol( fs_rng: &mut impl FeedableRNG<Error = Error>, polynomial_info: &PolynomialInfo, claimed_sum: F, proof: &Proof<F>, ) -> Result<SubClaim<F>, Error>
This function does the same thing as prove, but it uses a FeedableRNG as the transcript/to generate the
verifier challenges. This allows this sumcheck to be used as a part of a larger protocol.