pub struct CombinedPolyResolver<C: SetConfig>(/* private fields */);Expand description
Combined polynomial resolver.
Builds one sumcheck group over either the Q[X]-projected trace and the
$Q[X]$ family of constraints, or the $F_{q_i}[X]$ family
(for a specific $q_i$ prime). The MultiDegreeSumcheck at the protocol
layer batches them all together.
Food for thought:
The n+1 CPR groups could in principle be collapsed into a single
MultiDegreeSumcheck group sharing one evaluation-point trajectory, with
per-family soundness factor $q_i / q^*$. The shared-integer challenges
(folding $\alpha$, projecting $\psi$) are already in place; what remains is
fusing the per-family combination functions and writing down the
corresponding soundness lemma. The trade-off is loss of per-family
arithmetic locality — each $F_{q_i}[X]$ family currently does its
sumcheck work in its native (cheap) field, which a merged comb_fn would have
to give up or dispatch internally. Worth revisiting only if proof size /
verifier simplicity outweighs prover cost.
Implementations§
Source§impl<C> CombinedPolyResolver<C>where
C: BaseFieldConfig + ProjectPrimitiveIntegersWithConfig + 'static,
C::Integer: ConstTranscribable,
impl<C> CombinedPolyResolver<C>where
C: BaseFieldConfig + ProjectPrimitiveIntegersWithConfig + 'static,
C::Integer: ConstTranscribable,
Sourcepub fn prepare_sumcheck_group<U>(
trace_matrix: Vec<DenseMultilinearExtension<C::Element>>,
bit_op_down_mles: Vec<DenseMultilinearExtension<C::Element>>,
evaluation_point: &[C::Element],
projected_scalars: &ProjectedScalars<U::Scalar, C::Element>,
family_idx: usize,
num_constraints: usize,
num_vars: usize,
max_degree: usize,
folding_challenge: &C::Element,
field_cfg: &C,
) -> Result<(MultiDegreeSumcheckGroup<C>, CprProverAncillary), CombinedPolyResolverError<C::Element>>where
U::Scalar: 'static,
U: Uair,
pub fn prepare_sumcheck_group<U>(
trace_matrix: Vec<DenseMultilinearExtension<C::Element>>,
bit_op_down_mles: Vec<DenseMultilinearExtension<C::Element>>,
evaluation_point: &[C::Element],
projected_scalars: &ProjectedScalars<U::Scalar, C::Element>,
family_idx: usize,
num_constraints: usize,
num_vars: usize,
max_degree: usize,
folding_challenge: &C::Element,
field_cfg: &C,
) -> Result<(MultiDegreeSumcheckGroup<C>, CprProverAncillary), CombinedPolyResolverError<C::Element>>where
U::Scalar: 'static,
U: Uair,
Build the CPR sumcheck group for use in the multi-degree sumcheck.
Pre-sumcheck half of the CPR prover. Samples the folding challenge α,
builds the MLE vector and combination function with the constraint
polynomial identity:
$$
\sum_{b \in H} (f_0(b, x_0[b],…,x_n[b], x_0ˆdown[b],…,x_nˆdown[b])
+ \alpha f_1(…) + … + \alpha^k f_k(…)) = v_0 +
\alpha * v_1 + … + \alphaˆk * v_k,
$$
where $f_i(b, x_0[b],…,x_n[b], x_0ˆdown[b],…,x_nˆdown[b])
= eq(r, b) * (1 - eq(r, 1,…1))
* g_i(x_0[b],…,x_n[b], x_0ˆdown[b],…,x_nˆdown[b])$
and g_i is a constraint polynomial given by the UAIR U.
v_0,...,v_k are the claimed evaluations of the combined polynomials.
§Parameters
trace_matrix: The trace that have been projected to F.bit_op_down_mles: MLEs of the bit-op virtual columns, projected toF::Inner, inUairSignature::bit_op_specs()order. The caller is responsible for applying the bit-op (ROTR / SHR) entry-wise on the unprojected binary_poly source column before projection — see Lemma 2.3 of the Zinc+ paper. The length must equal the signature’sbit_op_specs().len().evaluation_point: The evaluation point for the claims.projected_scalars: The UAIR scalars projected toF.family_idx: which constraint family to fold.0-> $Q[X]$;i >= 1-> $F_{q_{i-1}}[X]$.num_constraints: The number of constraint polynomials in the UAIRU.num_vars: The number of variables of the trace MLEs.max_degree: The degree of the UAIRU.folding_challenge: pre-sampled batching challenge $\alpha$ used to batch the constraint claims.field_cfg: The random field config.
Sourcepub fn finalize_prover<U>(
transcript: &mut impl Transcript,
sumcheck_prover_state: SumcheckProverState<C>,
ancillary: CprProverAncillary,
field_cfg: &C,
) -> Result<(CprProof<C::Element>, CprProverState<C::Element>), CombinedPolyResolverError<C::Element>>where
U: Uair,
pub fn finalize_prover<U>(
transcript: &mut impl Transcript,
sumcheck_prover_state: SumcheckProverState<C>,
ancillary: CprProverAncillary,
field_cfg: &C,
) -> Result<(CprProof<C::Element>, CprProverState<C::Element>), CombinedPolyResolverError<C::Element>>where
U: Uair,
Finalize the CPR proof after the multi-degree sumcheck completes.
§Parameters
transcript: FS-transcript (absorbsup_evalsanddown_evals).sumcheck_prover_state: The CPR group’sProverStatefromMultiDegreeSumcheck::prove_as_subprotocol(states[0]).ancillary: Produced by [prepare_sumcheck_group]; carries column counts andnum_varsneeded to split the flat eval vector.field_cfg: Field configuration.
Sourcepub fn prepare_verifier<U>(
proof: &CprProof<C::Element>,
claimed_sum: C::Element,
ic_check_subclaim: &VerifierSubclaim<C::Element>,
num_constraints: usize,
num_vars: usize,
projecting_element: &C::Element,
folding_challenge: &C::Element,
field_cfg: &C,
) -> Result<CprVerifierAncillary<C::Element>, CombinedPolyResolverError<C::Element>>where
U: Uair,
pub fn prepare_verifier<U>(
proof: &CprProof<C::Element>,
claimed_sum: C::Element,
ic_check_subclaim: &VerifierSubclaim<C::Element>,
num_constraints: usize,
num_vars: usize,
projecting_element: &C::Element,
folding_challenge: &C::Element,
field_cfg: &C,
) -> Result<CprVerifierAncillary<C::Element>, CombinedPolyResolverError<C::Element>>where
U: Uair,
Pre-sumcheck half of the CPR verifier.
Must run before [MultiDegreeSumcheck::verify_as_subprotocol].
Pure check: takes the pre-sampled $\psi$ projecting element and the
pre-sampled batching challenge $\alpha$; does not touch the transcript.
§Parameters
proof: The CPR proof (up_evals,down_evals).claimed_sum: The claimed sum fromcombined_sumcheck.claimed_sums()[0].ic_check_subclaim: Subclaim from the ideal check; provides the evaluation point and claimed values used to verify the sumcheck sum.num_constraints: Number of constraint polynomials inU.num_vars: Number of variables of the trace MLEs.projecting_element: The random challenge used to projectF[X] → F.folding_challenge: pre-sampled batching challenge $\alpha$ used to batch the constraint claims.field_cfg: Field configuration.
Sourcepub fn finalize_verifier<U>(
transcript: &mut impl Transcript,
proof: CprProof<C::Element>,
shared_point: Vec<C::Element>,
expected_evaluation: C::Element,
ancillary: CprVerifierAncillary<C::Element>,
projected_scalars: &ProjectedScalars<U::Scalar, C::Element>,
family_idx: usize,
field_cfg: &C,
) -> Result<VerifierSubclaim<C::Element>, CombinedPolyResolverError<C::Element>>where
U: Uair,
pub fn finalize_verifier<U>(
transcript: &mut impl Transcript,
proof: CprProof<C::Element>,
shared_point: Vec<C::Element>,
expected_evaluation: C::Element,
ancillary: CprVerifierAncillary<C::Element>,
projected_scalars: &ProjectedScalars<U::Scalar, C::Element>,
family_idx: usize,
field_cfg: &C,
) -> Result<VerifierSubclaim<C::Element>, CombinedPolyResolverError<C::Element>>where
U: Uair,
Post-sumcheck half of the CPR verifier.
Runs after [MultiDegreeSumcheck::verify_as_subprotocol] produces the
shared evaluation point.
§Parameters
transcript: FS-transcript (absorbsup_evalsanddown_evals).proof: The CPR proof (consumed to produce the subclaim).shared_point: The shared evaluation pointr*from the multi-degree sumcheck.expected_evaluation:md_subclaims.expected_evaluations()[0]— the expected value of the CPR combination function atr*.ancillary: Produced by [prepare_verifier]; carries folding challenge powers, ideal-check evaluation point, andnum_vars.projected_scalars: UAIR scalars projected toF.family_idx: which constraint family.0-> $Q[X]$;i >= 1-> $F_{q_{i-1}}[X]$.field_cfg: Field configuration.
Auto Trait Implementations§
impl<C> Freeze for CombinedPolyResolver<C>
impl<C> RefUnwindSafe for CombinedPolyResolver<C>where
C: RefUnwindSafe,
impl<C> Send for CombinedPolyResolver<C>
impl<C> Sync for CombinedPolyResolver<C>
impl<C> Unpin for CombinedPolyResolver<C>where
C: Unpin,
impl<C> UnsafeUnpin for CombinedPolyResolver<C>
impl<C> UnwindSafe for CombinedPolyResolver<C>where
C: 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