halo2ccs

Function convert_halo2_circuit

Source
pub fn convert_halo2_circuit<HALO2: PrimeField<Repr = [u8; 32]>, C: Circuit<HALO2>, ARKWORKS: PrimeField>(
    k: u32,
    circuit: &C,
    instance: &[&[HALO2]],
) -> Result<(CCS<ARKWORKS>, Vec<ARKWORKS>, Vec<(HashSet<usize>, HashSet<ARKWORKS>)>, HashMap<AbsoluteCellPosition, usize>), Error>
Expand description

Converts a Halo2 circuit into a sonobe CCS instance.

  • k log_2(the height of the Plonkish table)
  • circuit A Halo2 circuit you wish to convert
  • instance Assignments to the instance columns. The length of this slice must equal the number of the instance columns in circuit.

Returns

  • A CCS instance
  • The witness vector Z
  • Lookup constraints
  • A map from a cell position in the original Plonkish table to the position in Z.

lookup constraints takes a form of Vec<(L, T)> where for every o ∈ L, z[o] must be in T.