Skip to main content

CombinedPolyResolver

Struct CombinedPolyResolver 

Source
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,

Source

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 to F::Inner, in UairSignature::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’s bit_op_specs().len().
  • evaluation_point: The evaluation point for the claims.
  • projected_scalars: The UAIR scalars projected to F.
  • 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 UAIR U.
  • num_vars: The number of variables of the trace MLEs.
  • max_degree: The degree of the UAIR U.
  • folding_challenge: pre-sampled batching challenge $\alpha$ used to batch the constraint claims.
  • field_cfg: The random field config.
Source

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 (absorbs up_evals and down_evals).
  • sumcheck_prover_state: The CPR group’s ProverState from MultiDegreeSumcheck::prove_as_subprotocol (states[0]).
  • ancillary: Produced by [prepare_sumcheck_group]; carries column counts and num_vars needed to split the flat eval vector.
  • field_cfg: Field configuration.
Source

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 from combined_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 in U.
  • num_vars: Number of variables of the trace MLEs.
  • projecting_element: The random challenge used to project F[X] → F.
  • folding_challenge: pre-sampled batching challenge $\alpha$ used to batch the constraint claims.
  • field_cfg: Field configuration.
Source

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 (absorbs up_evals and down_evals).
  • proof: The CPR proof (consumed to produce the subclaim).
  • shared_point: The shared evaluation point r* from the multi-degree sumcheck.
  • expected_evaluation: md_subclaims.expected_evaluations()[0] — the expected value of the CPR combination function at r*.
  • ancillary: Produced by [prepare_verifier]; carries folding challenge powers, ideal-check evaluation point, and num_vars.
  • projected_scalars: UAIR scalars projected to F.
  • family_idx: which constraint family. 0 -> $Q[X]$; i >= 1 -> $F_{q_{i-1}}[X]$.
  • field_cfg: Field configuration.

Auto Trait Implementations§

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<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.