pub struct PaddedSumcheckDecorator<F: Field, Inner> { /* private fields */ }Expand description
Decorator that pads the number of variables of an inner SumcheckProver.
Given an inner prover for the hypercube sum of an n-variate multilinear
$f(X_0, \ldots, X_{n-1}) = s$, this exposes a prover over n + n_extra_vars variables for the
equivalent claim
$$ f(X_0, \ldots, X_{n-1}) \cdot \text{eq}(0^{n_\text{extra}}, X_n, \ldots, X_{n+n_\text{extra}-1}) = s $$
Since $\text{eq}(0, \cdot)$ sums to 1 over the hypercube, this padded claim holds iff the original does. This is useful for batching sumchecks with unequal numbers of variables: a shorter sumcheck can be padded up to match a longer one.
The sumcheck protocol binds variables in high-index to low-index order, so the n_extra_vars
padding variables (the highest-indexed ones) are bound first. Concretely:
- In a padding round
i < n_extra_vars, the round polynomial is $R_i(X) = s \cdot \text{eq}(0, X) \cdot \prod_{k<i} \text{eq}(0, r_k)$, where $r_k$ is the $k$-th challenge. This is a genuine degree-1 polynomial built without touching the inner prover. It is emitted withdegree + 1coefficients, the ones above $X^1$ zero, so a batch that contains it has the full degree in every round, even when this prover is the only one of that degree. - In an inner round
i \ge n_extra_vars, the round polynomial is $R^\text{inner}{i - n\text{extra}}(X) \cdot \prod_{k<n_\text{extra}} \text{eq}(0, r_k)$.
The accumulated equality factor $\prod_{k} \text{eq}(0, r_k)$ over the padding challenges is
tracked in eq_prefix; it stops changing once the padding rounds are done.
Implementations§
Source§impl<F: Field, Inner: SumcheckProver<F>> PaddedSumcheckDecorator<F, Inner>
impl<F: Field, Inner: SumcheckProver<F>> PaddedSumcheckDecorator<F, Inner>
Sourcepub const fn new(
inner: Inner,
n_extra_vars: usize,
claims: Vec<F>,
degree: usize,
) -> Self
pub const fn new( inner: Inner, n_extra_vars: usize, claims: Vec<F>, degree: usize, ) -> Self
Wraps inner, padding its claim with n_extra_vars extra (highest-indexed) variables.
§Arguments
inner- The prover whose variable count is being raised.n_extra_vars- How many padding variables to prepend.claims- The inner prover’s claimed sums, one per claim.degree- The round degree the verifier reads, at least 1. The padding rounds are emitted at this degree.
Trait Implementations§
Source§impl<F: Clone + Field, Inner: Clone> Clone for PaddedSumcheckDecorator<F, Inner>
impl<F: Clone + Field, Inner: Clone> Clone for PaddedSumcheckDecorator<F, Inner>
Source§fn clone(&self) -> PaddedSumcheckDecorator<F, Inner>
fn clone(&self) -> PaddedSumcheckDecorator<F, Inner>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Field, Inner: SumcheckProver<F>> SumcheckProver<F> for PaddedSumcheckDecorator<F, Inner>
impl<F: Field, Inner: SumcheckProver<F>> SumcheckProver<F> for PaddedSumcheckDecorator<F, Inner>
Source§fn n_vars(&self) -> usize
fn n_vars(&self) -> usize
Source§fn execute(&mut self) -> Vec<RoundCoeffs<F>>
fn execute(&mut self) -> Vec<RoundCoeffs<F>>
Auto Trait Implementations§
impl<F, Inner> Freeze for PaddedSumcheckDecorator<F, Inner>
impl<F, Inner> RefUnwindSafe for PaddedSumcheckDecorator<F, Inner>where
Inner: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, Inner> Send for PaddedSumcheckDecorator<F, Inner>where
Inner: Send,
impl<F, Inner> Sync for PaddedSumcheckDecorator<F, Inner>where
Inner: Sync,
impl<F, Inner> Unpin for PaddedSumcheckDecorator<F, Inner>
impl<F, Inner> UnsafeUnpin for PaddedSumcheckDecorator<F, Inner>where
Inner: UnsafeUnpin,
F: UnsafeUnpin,
impl<F, Inner> UnwindSafe for PaddedSumcheckDecorator<F, Inner>where
Inner: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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