diff --git a/halo2_gadgets/src/ecc.rs b/halo2_gadgets/src/ecc.rs index 4861a20e52..f8da830b5f 100644 --- a/halo2_gadgets/src/ecc.rs +++ b/halo2_gadgets/src/ecc.rs @@ -812,7 +812,7 @@ pub(crate) mod tests { meta, advices[9], lookup_table, - table_range_check_tag, + Some(table_range_check_tag), ); EccChip::::configure(meta, advices, lagrange_coeffs, range_check) } diff --git a/halo2_gadgets/src/ecc/chip/mul_fixed/short.rs b/halo2_gadgets/src/ecc/chip/mul_fixed/short.rs index a10c54c1ed..0b576d50a7 100644 --- a/halo2_gadgets/src/ecc/chip/mul_fixed/short.rs +++ b/halo2_gadgets/src/ecc/chip/mul_fixed/short.rs @@ -528,7 +528,7 @@ pub mod tests { meta, advices[9], lookup_table, - table_range_check_tag, + Some(table_range_check_tag), ); EccChip::::configure(meta, advices, lagrange_coeffs, range_check) } @@ -853,7 +853,7 @@ pub mod tests { meta, advices[9], lookup_table, - table_range_check_tag, + Some(table_range_check_tag), ); EccChip::::configure(meta, advices, lagrange_coeffs, range_check) } diff --git a/halo2_gadgets/src/sinsemilla.rs b/halo2_gadgets/src/sinsemilla.rs index 7bae069dd8..0cfd821e98 100644 --- a/halo2_gadgets/src/sinsemilla.rs +++ b/halo2_gadgets/src/sinsemilla.rs @@ -658,14 +658,14 @@ pub(crate) mod tests { table_idx, meta.lookup_table_column(), meta.lookup_table_column(), - table_range_check_tag, + Some(table_range_check_tag), ); let range_check = LookupRangeCheckConfig::configure( meta, advices[9], table_idx, - table_range_check_tag, + Some(table_range_check_tag), ); let ecc_config = diff --git a/halo2_gadgets/src/sinsemilla/merkle.rs b/halo2_gadgets/src/sinsemilla/merkle.rs index 1eabfaa870..c9c088f16b 100644 --- a/halo2_gadgets/src/sinsemilla/merkle.rs +++ b/halo2_gadgets/src/sinsemilla/merkle.rs @@ -246,7 +246,7 @@ pub mod tests { meta.lookup_table_column(), meta.lookup_table_column(), meta.lookup_table_column(), - meta.lookup_table_column(), + Some(meta.lookup_table_column()), ); let range_check = diff --git a/halo2_gadgets/src/utilities/cond_swap.rs b/halo2_gadgets/src/utilities/cond_swap.rs index 78049e742a..46c0a5ded2 100644 --- a/halo2_gadgets/src/utilities/cond_swap.rs +++ b/halo2_gadgets/src/utilities/cond_swap.rs @@ -484,7 +484,7 @@ mod tests { meta, advices[9], table_idx, - table_range_check_tag, + Some(table_range_check_tag), ); let ecc_config = EccChip::::configure( diff --git a/halo2_gadgets/src/utilities/lookup_range_check.rs b/halo2_gadgets/src/utilities/lookup_range_check.rs index 04e94e30df..8d14462c68 100644 --- a/halo2_gadgets/src/utilities/lookup_range_check.rs +++ b/halo2_gadgets/src/utilities/lookup_range_check.rs @@ -219,50 +219,68 @@ impl LookupRangeCheckConfig { layouter.assign_table( || "table_idx", |mut table| { - // We generate the row values lazily (we only need them during keygen). - for index in 0..(1 << K) { - table.assign_cell( - || "table_idx", - self.table_idx, - index, - || Value::known(F::from(index as u64)), - )?; - table.assign_cell( - || "table_range_check_tag", - self.table_range_check_tag, - index, - || Value::known(F::ZERO), - )?; - } - for index in 0..(1 << 4) { - let new_index = index + (1 << K); - table.assign_cell( - || "table_idx", - self.table_idx, - new_index, - || Value::known(F::from(index as u64)), - )?; - table.assign_cell( - || "table_range_check_tag", - self.table_range_check_tag, - new_index, - || Value::known(F::from(4_u64)), - )?; - } - for index in 0..(1 << 5) { - let new_index = index + (1 << K) + (1 << 4); - table.assign_cell( - || "table_idx", - self.table_idx, - new_index, - || Value::known(F::from(index as u64)), - )?; - table.assign_cell( - || "table_range_check_tag", - self.table_range_check_tag, - new_index, - || Value::known(F::from(5_u64)), - )?; + match self.zsa { + // Non-ZSA variant + None => { + // We generate the row values lazily (we only need them during keygen). + for index in 0..(1 << K) { + table.assign_cell( + || "table_idx", + self.table_idx, + index, + || Value::known(F::from(index as u64)), + )?; + } + } + + // ZSA variant + Some(zsa) => { + // We generate the row values lazily (we only need them during keygen). + for index in 0..(1 << K) { + table.assign_cell( + || "table_idx", + self.table_idx, + index, + || Value::known(F::from(index as u64)), + )?; + table.assign_cell( + || "table_range_check_tag", + zsa.table_range_check_tag, + index, + || Value::known(F::ZERO), + )?; + } + for index in 0..(1 << 4) { + let new_index = index + (1 << K); + table.assign_cell( + || "table_idx", + self.table_idx, + new_index, + || Value::known(F::from(index as u64)), + )?; + table.assign_cell( + || "table_range_check_tag", + zsa.table_range_check_tag, + new_index, + || Value::known(F::from(4_u64)), + )?; + } + for index in 0..(1 << 5) { + let new_index = index + (1 << K) + (1 << 4); + table.assign_cell( + || "table_idx", + self.table_idx, + new_index, + || Value::known(F::from(index as u64)), + )?; + table.assign_cell( + || "table_range_check_tag", + zsa.table_range_check_tag, + new_index, + || Value::known(F::from(5_u64)), + )?; + } + } } Ok(()) }, @@ -539,7 +557,7 @@ mod tests { meta, running_sum, table_idx, - table_range_check_tag, + Some(table_range_check_tag), ) } @@ -644,7 +662,7 @@ mod tests { meta, running_sum, table_idx, - table_range_check_tag, + Some(table_range_check_tag), ) }