Skip to main content

MLSumcheck

Struct MLSumcheck 

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

Sumcheck for products of multilinear polynomial.

Implementations§

Source§

impl<F: FromPrimitiveWithConfig> MLSumcheck<F>

Source

pub fn prove_as_subprotocol( transcript: &mut impl Transcript, mles: Vec<DenseMultilinearExtension<F::Inner>>, nvars: usize, degree: usize, comb_fn: impl Fn(&[F]) -> F + Send + Sync, config: &F::Config, ) -> (SumcheckProof<F>, ProverState<F>)

Sumcheck prover main entry point.

This function executes the Prover side of the Sumcheck protocol. It verifies a claim of the form:

$$ \sum_{x \in {0, 1}^{\text{nvars}}} \text{comb\_fn}(\text{mles}(x)) = \text{claimed\_sum}. $$

It is designed to be used as a subprotocol within a larger system since it takes the FS transcript (transcript argument) as input and returns the internal ProverState alongside the final proof.

The claimed sum is derived by the prover.


§Arguments
  • transcript: A mutable reference to a Fiat-Shamir Transcript.
  • mles: A Vec of dense multilinear extension over the base field F. The sumcheck polynomial is made over the combined result of these multilinear extensions.
  • nvars: The number of variables over which the mles are defined. This must be consistent across all mles.
  • degree: The maximum combined degree of the mles under the comb_fn.
  • comb_fn: A closure that defines the combination function $G(\text{mles}(x))$. It takes a slice of field elements (the evaluations of the mles at a point $x$) and returns a single field element.
  • config: The configuration for the underlying field used in the protocol.

§Returns

A tuple containing:

  1. SumcheckProof<F>: The final sumcheck proof.
  2. ProverState<F>: The state of the Prover after the protocol completes.

§Panics
  • Panics if the number of variables is 0.
Source

pub fn verify_as_subprotocol( transcript: &mut impl Transcript, num_vars: usize, degree: usize, proof: &SumcheckProof<F>, config: &F::Config, ) -> Result<Subclaim<F>, SumCheckError<F>>
where F::Inner: ConstTranscribable, F::Modulus: ConstTranscribable,

Sumcheck verifier main entry point.

This function executes the Verifier side of the Sumcheck protocol. It takes a proof and a claimed_sum and verifies the intermediate steps of the sumcheck.

The sumcheck verifies the claim:

$$ \sum_{x \in {0, 1}^{\text{num\_vars}}} G(x) = \text{claimed\_sum}. $$

It is designed to be used as a subprotocol within a larger system. If successful, it returns a Subclaim, a final equation that the outer protocol must satisfy for the overall proof to be valid.


§Arguments
  • transcript: A mutable reference to a Fiat-Shamir Transcript.
  • num_vars: The number of variables over which the sum was originally computed.
  • degree: The maximum combined degree of the underlying polynomial $G(x)$. This must match the degree used by the Prover.
  • proof: A reference to the SumcheckProof<F> generated by the Prover.
  • config: The configuration for the underlying field used in the protocol.

§Returns

A Result which is:

  • Ok(Subclaim<F>): If the Sumcheck protocol passes successfully, it returns a Subclaim. This claim consists of:

    1. The final random challenge point $r \in \text{F}^{\text{num\_vars}}$.
    2. The expected evaluation $v$ of the combined polynomial $G(r)$ at that point.
  • Err(SumCheckError<F>): If any of the round checks fail during the protocol.


§Panics
  • Panics if the number of variables is 0.

Auto Trait Implementations§

§

impl<F> Freeze for MLSumcheck<F>

§

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

§

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

§

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

§

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

§

impl<F> UnsafeUnpin for MLSumcheck<F>

§

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<F, T> IntoWithConfig<F> for T
where F: PrimeField + FromWithConfig<T>,

§

fn into_with_cfg(self, cfg: &<F as PrimeField>::Config) -> F

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V