diff --git a/kimchi/src/bench.rs b/kimchi/src/bench.rs index 97cb026a2e..57cd64ff80 100644 --- a/kimchi/src/bench.rs +++ b/kimchi/src/bench.rs @@ -77,7 +77,12 @@ impl BenchmarkCtx { } /// Produces a proof - pub fn create_proof(&self) -> (ProverProof>, Vec) { + pub fn create_proof( + &self, + ) -> ( + ProverProof, KIMCHI_COLS>, + Vec, + ) { // create witness let witness: [Vec; KIMCHI_COLS] = array::from_fn(|_| vec![1u32.into(); self.num_gates]); @@ -97,7 +102,13 @@ impl BenchmarkCtx { } #[allow(clippy::type_complexity)] - pub fn batch_verification(&self, batch: &[(ProverProof>, Vec)]) { + pub fn batch_verification( + &self, + batch: &[( + ProverProof, KIMCHI_COLS>, + Vec, + )], + ) { // verify the proof let batch: Vec<_> = batch .iter() diff --git a/kimchi/src/circuits/argument.rs b/kimchi/src/circuits/argument.rs index d4bde64d82..2f862bf1d7 100644 --- a/kimchi/src/circuits/argument.rs +++ b/kimchi/src/circuits/argument.rs @@ -13,7 +13,6 @@ use serde::{Deserialize, Serialize}; use super::{ expr::{constraints::ExprOps, Cache, ConstantExpr, Constants}, gate::{CurrOrNext, GateType}, - wires::KIMCHI_COLS, }; use CurrOrNext::{Curr, Next}; @@ -37,8 +36,8 @@ pub enum ArgumentType { /// created with ArgumentData and F = Field or F = PrimeField, then the constraints /// are built as expressions of real field elements and can be evaluated directly on /// the witness without using the prover. -pub struct ArgumentEnv { - data: Option>, +pub struct ArgumentEnv { + data: Option>, phantom_data: PhantomData, } @@ -52,14 +51,10 @@ impl Default for ArgumentEnv { } } -impl, const COLUMNS: usize> ArgumentEnv { +impl> ArgumentEnv { /// Initialize the environment for creating constraints of real field elements that can be /// evaluated directly over the witness without the prover/verifier - pub fn create( - witness: ArgumentWitness, - coeffs: Vec, - constants: Constants, - ) -> Self { + pub fn create(witness: ArgumentWitness, coeffs: Vec, constants: Constants) -> Self { ArgumentEnv { data: Some(ArgumentData { witness, @@ -134,9 +129,9 @@ impl, const COLUMNS: usize> ArgumentEnv { } /// Argument environment data for constraints of field elements -pub struct ArgumentData { +pub struct ArgumentData { /// Witness rows - pub witness: ArgumentWitness, + pub witness: ArgumentWitness, /// Gate coefficients pub coeffs: Vec, /// Constants @@ -144,14 +139,14 @@ pub struct ArgumentData { } /// Witness data for a argument -pub struct ArgumentWitness { +pub struct ArgumentWitness { /// Witness for current row - pub curr: [T; COLUMNS], + pub curr: Vec, /// Witness for next row - pub next: [T; COLUMNS], + pub next: Vec, } -impl std::ops::Index<(CurrOrNext, usize)> for ArgumentWitness { +impl std::ops::Index<(CurrOrNext, usize)> for ArgumentWitness { type Output = T; fn index(&self, idx: (CurrOrNext, usize)) -> &T { @@ -173,10 +168,7 @@ pub trait Argument { const CONSTRAINTS: u32; /// Constraints for this argument - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - cache: &mut Cache, - ) -> Vec; + fn constraint_checks>(env: &ArgumentEnv, cache: &mut Cache) -> Vec; /// Returns the set of constraints required to prove this argument. fn constraints(cache: &mut Cache) -> Vec> { diff --git a/kimchi/src/circuits/expr.rs b/kimchi/src/circuits/expr.rs index 90150e237f..7bf57b785d 100644 --- a/kimchi/src/circuits/expr.rs +++ b/kimchi/src/circuits/expr.rs @@ -2662,20 +2662,13 @@ pub mod constraints { fn literal(x: F) -> Self; // Witness variable - fn witness( - row: CurrOrNext, - col: usize, - env: Option<&ArgumentData>, - ) -> Self; + fn witness(row: CurrOrNext, col: usize, env: Option<&ArgumentData>) -> Self; /// Coefficient - fn coeff(col: usize, env: Option<&ArgumentData>) -> Self; + fn coeff(col: usize, env: Option<&ArgumentData>) -> Self; /// Create a constant - fn constant( - expr: ConstantExpr, - env: Option<&ArgumentData>, - ) -> Self; + fn constant(expr: ConstantExpr, env: Option<&ArgumentData>) -> Self; /// Cache item fn cache(&self, cache: &mut Cache) -> Self; @@ -2735,22 +2728,15 @@ pub mod constraints { Expr::Constant(ConstantExpr::Literal(x)) } - fn witness( - row: CurrOrNext, - col: usize, - _: Option<&ArgumentData>, - ) -> Self { + fn witness(row: CurrOrNext, col: usize, _: Option<&ArgumentData>) -> Self { witness(col, row) } - fn coeff(col: usize, _: Option<&ArgumentData>) -> Self { + fn coeff(col: usize, _: Option<&ArgumentData>) -> Self { coeff(col) } - fn constant( - expr: ConstantExpr, - _: Option<&ArgumentData>, - ) -> Self { + fn constant(expr: ConstantExpr, _: Option<&ArgumentData>) -> Self { Expr::Constant(expr) } @@ -2800,28 +2786,21 @@ pub mod constraints { x } - fn witness( - row: CurrOrNext, - col: usize, - env: Option<&ArgumentData>, - ) -> Self { + fn witness(row: CurrOrNext, col: usize, env: Option<&ArgumentData>) -> Self { match env { Some(data) => data.witness[(row, col)], None => panic!("Missing witness"), } } - fn coeff(col: usize, env: Option<&ArgumentData>) -> Self { + fn coeff(col: usize, env: Option<&ArgumentData>) -> Self { match env { Some(data) => data.coeffs[col], None => panic!("Missing coefficients"), } } - fn constant( - expr: ConstantExpr, - env: Option<&ArgumentData>, - ) -> Self { + fn constant(expr: ConstantExpr, env: Option<&ArgumentData>) -> Self { match env { Some(data) => expr.value(&data.constants), None => panic!("Missing constants"), diff --git a/kimchi/src/circuits/gate.rs b/kimchi/src/circuits/gate.rs index cdbd44a6a5..3163eeee5b 100644 --- a/kimchi/src/circuits/gate.rs +++ b/kimchi/src/circuits/gate.rs @@ -264,8 +264,7 @@ impl CircuitGate { zk_rows: cs.zk_rows, }; // Create the argument environment for the constraints over field elements - let env = - ArgumentEnv::::create(argument_witness, self.coeffs.clone(), constants); + let env = ArgumentEnv::::create(argument_witness, self.coeffs.clone(), constants); // Check the wiring (i.e. copy constraints) for this gate // Note: Gates can operated on row Curr or Curr and Next. @@ -300,9 +299,7 @@ impl CircuitGate { // TODO: implement the verification for the generic gate vec![] } - GateType::Poseidon => { - poseidon::Poseidon::constraint_checks::(&env, &mut cache) - } + GateType::Poseidon => poseidon::Poseidon::constraint_checks(&env, &mut cache), GateType::CompleteAdd => complete_add::CompleteAdd::constraint_checks(&env, &mut cache), GateType::VarBaseMul => varbasemul::VarbaseMul::constraint_checks(&env, &mut cache), GateType::EndoMul => endosclmul::EndosclMul::constraint_checks(&env, &mut cache), @@ -361,7 +358,7 @@ impl CircuitGate { &self, row: usize, witness: &[Vec; COLUMNS], - ) -> CircuitGateResult> { + ) -> CircuitGateResult> { // Get the part of the witness relevant to this gate let witness_curr: [F; COLUMNS] = (0..witness.len()) .map(|col| witness[col][row]) @@ -378,9 +375,9 @@ impl CircuitGate { [F::zero(); COLUMNS] }; - Ok(ArgumentWitness:: { - curr: witness_curr, - next: witness_next, + Ok(ArgumentWitness:: { + curr: witness_curr.to_vec(), + next: witness_next.to_vec(), }) } } diff --git a/kimchi/src/circuits/lookup/lookups.rs b/kimchi/src/circuits/lookup/lookups.rs index d8694c19d4..5a41485449 100644 --- a/kimchi/src/circuits/lookup/lookups.rs +++ b/kimchi/src/circuits/lookup/lookups.rs @@ -780,16 +780,12 @@ pub mod wasm { lookup: bool, range_check: bool, foreign_field_mul: bool, - keccak_round: bool, - keccak_sponge: bool, ) -> LookupPatterns { LookupPatterns { xor, lookup, range_check, foreign_field_mul, - keccak_round, - keccak_sponge, } } } diff --git a/kimchi/src/circuits/lookup/tables/bits16.rs b/kimchi/src/circuits/lookup/tables/bits16.rs index 91db8ae786..50ae56b613 100644 --- a/kimchi/src/circuits/lookup/tables/bits16.rs +++ b/kimchi/src/circuits/lookup/tables/bits16.rs @@ -6,6 +6,10 @@ use super::BITS16_TABLE_ID; //~ The lookup table for 16-bits /// Returns the lookup table for all 16-bit values +/// +/// # Panics +/// +/// Will panic if `data` is invalid. pub fn bits16_table() -> LookupTable { let mut data = vec![vec![]; 1]; diff --git a/kimchi/src/circuits/lookup/tables/reset.rs b/kimchi/src/circuits/lookup/tables/reset.rs index 9e359f3ad9..2be1e04bd3 100644 --- a/kimchi/src/circuits/lookup/tables/reset.rs +++ b/kimchi/src/circuits/lookup/tables/reset.rs @@ -8,6 +8,10 @@ use super::RESET_TABLE_ID; //~ The first column contains the 16-bit values, and the second column contains their expansion to 64-bit values. /// Returns the sparse lookup table +/// +/// # Panics +/// +/// Will panic if `data` is invalid. pub fn reset_table() -> LookupTable { let mut data = vec![vec![]; 2]; diff --git a/kimchi/src/circuits/lookup/tables/sparse.rs b/kimchi/src/circuits/lookup/tables/sparse.rs index e33130197f..e1a3fcc79d 100644 --- a/kimchi/src/circuits/lookup/tables/sparse.rs +++ b/kimchi/src/circuits/lookup/tables/sparse.rs @@ -5,6 +5,10 @@ use ark_ff::Field; //~ This is a 1-column table containing the sparse representation of all 16-bit preimages. /// Returns the sparse lookup table +/// +/// # Panics +/// +/// Will panic if `data` is invalid. pub fn sparse_table() -> LookupTable { let mut data = vec![vec![]; 1]; diff --git a/kimchi/src/circuits/lookup/tables/xor.rs b/kimchi/src/circuits/lookup/tables/xor.rs index 3ecc9d3b4f..d846942a31 100644 --- a/kimchi/src/circuits/lookup/tables/xor.rs +++ b/kimchi/src/circuits/lookup/tables/xor.rs @@ -14,6 +14,10 @@ use ark_ff::Field; //~ will translate into a scalar multiplication by 0, which is free. /// Returns the XOR lookup table +/// +/// # Panics +/// +/// Will panic if `data` is invalid. pub fn xor_table() -> LookupTable { let mut data = vec![vec![]; 3]; diff --git a/kimchi/src/circuits/polynomials/complete_add.rs b/kimchi/src/circuits/polynomials/complete_add.rs index 3b39b9d711..578af66046 100644 --- a/kimchi/src/circuits/polynomials/complete_add.rs +++ b/kimchi/src/circuits/polynomials/complete_add.rs @@ -97,10 +97,7 @@ where const ARGUMENT_TYPE: ArgumentType = ArgumentType::Gate(GateType::CompleteAdd); const CONSTRAINTS: u32 = 7; - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, cache: &mut Cache) -> Vec { // This function makes 2 + 1 + 1 + 1 + 2 = 7 constraints let x1 = env.witness_curr(0); let y1 = env.witness_curr(1); diff --git a/kimchi/src/circuits/polynomials/endomul_scalar.rs b/kimchi/src/circuits/polynomials/endomul_scalar.rs index 5e46d74432..731d7841e1 100644 --- a/kimchi/src/circuits/polynomials/endomul_scalar.rs +++ b/kimchi/src/circuits/polynomials/endomul_scalar.rs @@ -167,10 +167,7 @@ where const ARGUMENT_TYPE: ArgumentType = ArgumentType::Gate(GateType::EndoMulScalar); const CONSTRAINTS: u32 = 11; - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, cache: &mut Cache) -> Vec { let n0 = env.witness_curr(0); let n8 = env.witness_curr(1); let a0 = env.witness_curr(2); diff --git a/kimchi/src/circuits/polynomials/endosclmul.rs b/kimchi/src/circuits/polynomials/endosclmul.rs index 63156559c8..8bbcb2e0b4 100644 --- a/kimchi/src/circuits/polynomials/endosclmul.rs +++ b/kimchi/src/circuits/polynomials/endosclmul.rs @@ -186,10 +186,7 @@ where const ARGUMENT_TYPE: ArgumentType = ArgumentType::Gate(GateType::EndoMul); const CONSTRAINTS: u32 = 11; - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, cache: &mut Cache) -> Vec { let b1 = env.witness_curr(11); let b2 = env.witness_curr(12); let b3 = env.witness_curr(13); diff --git a/kimchi/src/circuits/polynomials/foreign_field_add/circuitgates.rs b/kimchi/src/circuits/polynomials/foreign_field_add/circuitgates.rs index 289d31a6bf..cc25e60565 100644 --- a/kimchi/src/circuits/polynomials/foreign_field_add/circuitgates.rs +++ b/kimchi/src/circuits/polynomials/foreign_field_add/circuitgates.rs @@ -142,10 +142,7 @@ where const ARGUMENT_TYPE: ArgumentType = ArgumentType::Gate(GateType::ForeignFieldAdd); const CONSTRAINTS: u32 = 4; - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { let foreign_modulus: [T; LIMB_COUNT] = array::from_fn(|i| env.coeff(i)); // stored as coefficient for better correspondance with the relation being proved diff --git a/kimchi/src/circuits/polynomials/foreign_field_mul/circuitgates.rs b/kimchi/src/circuits/polynomials/foreign_field_mul/circuitgates.rs index b4e390ccd8..4baa6a9eb9 100644 --- a/kimchi/src/circuits/polynomials/foreign_field_mul/circuitgates.rs +++ b/kimchi/src/circuits/polynomials/foreign_field_mul/circuitgates.rs @@ -193,10 +193,7 @@ where const CONSTRAINTS: u32 = 11; // DEGREE is 4 - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { let mut constraints = vec![]; // diff --git a/kimchi/src/circuits/polynomials/generic.rs b/kimchi/src/circuits/polynomials/generic.rs index 29bd71b825..77a985ad45 100644 --- a/kimchi/src/circuits/polynomials/generic.rs +++ b/kimchi/src/circuits/polynomials/generic.rs @@ -74,10 +74,7 @@ where const ARGUMENT_TYPE: ArgumentType = ArgumentType::Gate(GateType::Generic); const CONSTRAINTS: u32 = 2; - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { // First generic gate let left_coeff1 = env.coeff(0); let right_coeff1 = env.coeff(1); diff --git a/kimchi/src/circuits/polynomials/poseidon.rs b/kimchi/src/circuits/polynomials/poseidon.rs index b690ce45fd..a636570d5b 100644 --- a/kimchi/src/circuits/polynomials/poseidon.rs +++ b/kimchi/src/circuits/polynomials/poseidon.rs @@ -337,10 +337,7 @@ where const ARGUMENT_TYPE: ArgumentType = ArgumentType::Gate(GateType::Poseidon); const CONSTRAINTS: u32 = 15; - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, cache: &mut Cache) -> Vec { let mut res = vec![]; let mut idx = 0; diff --git a/kimchi/src/circuits/polynomials/range_check/circuitgates.rs b/kimchi/src/circuits/polynomials/range_check/circuitgates.rs index 6e4b3def8e..f543aae001 100644 --- a/kimchi/src/circuits/polynomials/range_check/circuitgates.rs +++ b/kimchi/src/circuits/polynomials/range_check/circuitgates.rs @@ -178,10 +178,7 @@ where // * Operates on Curr row // * Range constrain all limbs except vp0 and vp1 (barring plookup constraints, which are done elsewhere) // * Constrain that combining all limbs equals the limb stored in column 0 - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { // 1) Apply range constraints on the limbs // * Columns 1-2 are 12-bit copy constraints // * They are copied 3 rows ahead (to the final row) and are constrained by lookups @@ -282,10 +279,7 @@ where // * Operates on Curr and Next row // * Range constrain all limbs (barring plookup constraints, which are done elsewhere) // * Constrain that combining all limbs equals the value v2 stored in row Curr, column 0 - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { // 1) Apply range constraints on limbs for Curr row // * Column 2 is a 2-bit crumb let mut constraints = vec![crumb(&env.witness_curr(2))]; diff --git a/kimchi/src/circuits/polynomials/rot.rs b/kimchi/src/circuits/polynomials/rot.rs index e1ef1e4acb..71bcdef994 100644 --- a/kimchi/src/circuits/polynomials/rot.rs +++ b/kimchi/src/circuits/polynomials/rot.rs @@ -213,10 +213,7 @@ where // (stored in coefficient as a power-of-two form) // * Operates on Curr row // * Shifts the words by `rot` bits and then adds the excess to obtain the rotated word. - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { // Check that the last 8 columns are 2-bit crumbs // C1..C8: x * (x - 1) * (x - 2) * (x - 3) = 0 let mut constraints = (7..KIMCHI_COLS) diff --git a/kimchi/src/circuits/polynomials/turshi.rs b/kimchi/src/circuits/polynomials/turshi.rs index 6a8a76fd85..7a40b318ff 100644 --- a/kimchi/src/circuits/polynomials/turshi.rs +++ b/kimchi/src/circuits/polynomials/turshi.rs @@ -772,10 +772,7 @@ where /// Generates the constraints for the Cairo initial claim and first memory checks /// Accesses Curr and Next rows - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { let pc_ini = env.witness_curr(0); // copy from public input let ap_ini = env.witness_curr(1); // copy from public input let pc_fin = env.witness_curr(2); // copy from public input @@ -812,10 +809,7 @@ where /// Generates the constraints for the Cairo instruction /// Accesses Curr and Next rows - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, cache: &mut Cache) -> Vec { // load all variables of the witness corresponding to Cairoinstruction gates let pc = env.witness_curr(0); let ap = env.witness_curr(1); @@ -961,10 +955,7 @@ where /// Generates the constraints for the Cairo flags /// Accesses Curr and Next rows - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { // Load current row let f_pc_abs = env.witness_curr(7); let f_pc_rel = env.witness_curr(8); @@ -1031,10 +1022,7 @@ where /// Generates the constraints for the Cairo transition /// Accesses Curr and Next rows (Next only first 3 entries) - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { // load computed updated registers let pcup = env.witness_curr(7); let apup = env.witness_curr(8); diff --git a/kimchi/src/circuits/polynomials/varbasemul.rs b/kimchi/src/circuits/polynomials/varbasemul.rs index 9f9e524c0b..a21f7305ab 100644 --- a/kimchi/src/circuits/polynomials/varbasemul.rs +++ b/kimchi/src/circuits/polynomials/varbasemul.rs @@ -176,10 +176,7 @@ impl Point { } impl Point { - pub fn new_from_env, const COLUMNS: usize>( - &self, - env: &ArgumentEnv, - ) -> Point { + pub fn new_from_env>(&self, env: &ArgumentEnv) -> Point { Point::create(self.x.new_from_env(env), self.y.new_from_env(env)) } } @@ -290,7 +287,7 @@ trait FromWitness where F: PrimeField, { - fn new_from_env(&self, env: &ArgumentEnv) -> T; + fn new_from_env(&self, env: &ArgumentEnv) -> T; } impl FromWitness for Variable @@ -298,7 +295,7 @@ where F: PrimeField, T: ExprOps, { - fn new_from_env(&self, env: &ArgumentEnv) -> T { + fn new_from_env(&self, env: &ArgumentEnv) -> T { let column_to_index = |_| match self.col { Column::Witness(i) => i, _ => panic!("Can't get index from witness columns"), @@ -334,10 +331,7 @@ impl Layout { } } - fn new_from_env, const COLUMNS: usize>( - &self, - env: &ArgumentEnv, - ) -> Layout { + fn new_from_env>(&self, env: &ArgumentEnv) -> Layout { Layout { accs: self.accs.map(|point| point.new_from_env(env)), bits: self.bits.map(|var| var.new_from_env(env)), @@ -420,10 +414,7 @@ where const ARGUMENT_TYPE: ArgumentType = ArgumentType::Gate(GateType::VarBaseMul); const CONSTRAINTS: u32 = 21; - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, cache: &mut Cache) -> Vec { let Layout { base, accs, @@ -431,7 +422,7 @@ where ss, n_prev, n_next, - } = Layout::create().new_from_env::(env); + } = Layout::create().new_from_env::(env); // n' // = 2^5 * n + 2^4 b0 + 2^3 b1 + 2^2 b2 + 2^1 b3 + b4 diff --git a/kimchi/src/circuits/polynomials/xor.rs b/kimchi/src/circuits/polynomials/xor.rs index 630df1d2c9..431734926a 100644 --- a/kimchi/src/circuits/polynomials/xor.rs +++ b/kimchi/src/circuits/polynomials/xor.rs @@ -149,10 +149,7 @@ where // * Operates on Curr and Next rows // * Constrain the decomposition of `in1`, `in2` and `out` of multiples of 16 bits // * The actual XOR is performed thanks to the plookups of 4-bit XORs. - fn constraint_checks, const COLUMNS: usize>( - env: &ArgumentEnv, - _cache: &mut Cache, - ) -> Vec { + fn constraint_checks>(env: &ArgumentEnv, _cache: &mut Cache) -> Vec { let two = T::from(2u64); // in1 = in1_0 + in1_1 * 2^4 + in1_2 * 2^8 + in1_3 * 2^12 + next_in1 * 2^16 // in2 = in2_0 + in2_1 * 2^4 + in2_2 * 2^8 + in2_3 * 2^12 + next_in2 * 2^16