MLSumcheck

Struct MLSumcheck 

Source
pub struct MLSumcheck<F: Field>(/* private fields */);
Expand description

Sumcheck for products of multilinear polynomial

Implementations§

Source§

impl<F: Field> MLSumcheck<F>

Source

pub fn extract_sum(proof: &Proof<F>) -> F

extract sum from the proof

Source

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}$$

Source

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.

Source

pub fn verify( polynomial_info: &PolynomialInfo, claimed_sum: F, proof: &Proof<F>, ) -> Result<SubClaim<F>, Error>

verify the claimed sum using the proof

Source

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.

Auto Trait Implementations§

§

impl<F> Freeze for MLSumcheck<F>

§

impl<F> RefUnwindSafe for MLSumcheck<F>
where F: RefUnwindSafe,

§

impl<F> Send for MLSumcheck<F>

§

impl<F> Sync for MLSumcheck<F>

§

impl<F> Unpin for MLSumcheck<F>
where F: Unpin,

§

impl<F> UnwindSafe for MLSumcheck<F>
where F: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V