Skip to main content

reduce_constraints

Function reduce_constraints 

Source
pub fn reduce_constraints<Channel>(
    cs: &ConstraintSystem,
    log_instances: usize,
    channel: &mut Channel,
) -> Result<ReductionOutput<Channel::Elem>, Error>
where Channel: IOPVerifierChannel<B128>, Channel::Elem: FieldOps<Scalar = B128> + From<B128>,
Expand description

Reduces every constraint of 2^log_instances instances to operand claims at one point.

The reductions run in this order, and the order is load-bearing:

IntMul -> BinMul -> BitAnd -> Zero

The caller then runs the shift reduction on the operand claims, reads the public segment’s evaluation with verify_public_eval, and closes the shift with shift::check_eval.

§Arguments

  • cs: the single-instance constraint system every instance satisfies.
  • log_instances: the base-2 logarithm of the instance count, 0 for a single circuit.
  • channel: the verifier channel that reads messages and redraws Fiat-Shamir challenges.

§Errors

Returns an error if any reduction’s sumcheck fails.

§Soundness

IntMul and BinMul must run before BitAnd. BitAnd draws the univariate challenge that collapses their per-bit operand evaluations. Committing those evaluations first stops a prover choosing them as a function of it.

Do not reorder these, and keep the same order in the prover.