pub struct MLSumcheck<F>(/* private fields */);Expand description
Sumcheck for products of multilinear polynomial.
Implementations§
Source§impl<F: FromPrimitiveWithConfig> MLSumcheck<F>
impl<F: FromPrimitiveWithConfig> MLSumcheck<F>
Sourcepub 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>)where
F: InnerTransparentField,
F::Inner: ConstTranscribable + Zero,
F::Modulus: ConstTranscribable,
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>)where
F: InnerTransparentField,
F::Inner: ConstTranscribable + Zero,
F::Modulus: ConstTranscribable,
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-ShamirTranscript.mles: AVecof dense multilinear extension over the base fieldF. The sumcheck polynomial is made over the combined result of these multilinear extensions.nvars: The number of variables over which themlesare defined. This must be consistent across allmles.degree: The maximum combined degree of themlesunder thecomb_fn.comb_fn: A closure that defines the combination function $G(\text{mles}(x))$. It takes a slice of field elements (the evaluations of themlesat a point $x$) and returns a single field element.config: The configuration for the underlying field used in the protocol.
§Returns
A tuple containing:
SumcheckProof<F>: The final sumcheck proof.ProverState<F>: The state of the Prover after the protocol completes.
§Panics
- Panics if the number of variables is
0.
Sourcepub 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,
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-ShamirTranscript.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 theSumcheckProof<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 aSubclaim. This claim consists of:- The final random challenge point $r \in \text{F}^{\text{num\_vars}}$.
- 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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