halo2_base::gates::flex_gate::threads::single_phase

Function assign_with_constraints

Source
pub fn assign_with_constraints<F: ScalarField, const ROTATIONS: usize>(
    threads: &[Context<F>],
    basic_gates: &[BasicGateConfig<F>],
    region: &mut Region<'_, F>,
    copy_manager: &mut CopyConstraintManager<F>,
    max_rows: usize,
    use_unknown: bool,
) -> ThreadBreakPoints
Expand description

Assigns all virtual threads to the physical columns in basic_gates and returns the break points. Also enables corresponding selectors and adds raw assigned cells to the copy_manager. This function should be called either during proving & verifier key generation or when running MockProver.

For proof generation, see assign_witnesses.

This is generic for a “vertical” custom gate that uses a single column and ROTATIONS contiguous rows in that column.

⚠️ Right now we only support “overlaps” where you can have the gate enabled at offset and offset + ROTATIONS - 1, but not at offset + delta where delta < ROTATIONS - 1.

§Inputs

  • max_rows: The number of rows that can be used for the assignment. This is the number of rows that are not blinded for zero-knowledge.
  • If use_unknown is true, then the advice columns will be assigned as unknowns.

§Assumptions

  • All basic_gates are in the same phase.