Skip to content

Commit

Permalink
fix: minor code quality fixes (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang committed May 23, 2023
1 parent 0fff063 commit 2d2c7ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion halo2-base/src/gates/flex_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl<F: ScalarField> BasicGateConfig<F> {
/// Wrapper for [ConstraintSystem].create_gate(name, meta) creates a gate form [q * (a + b * c - out)].
/// * `meta`: [ConstraintSystem] used for the gate
fn create_gate(&self, meta: &mut ConstraintSystem<F>) {
meta.create_gate("1 column a * b + c = out", |meta| {
meta.create_gate("1 column a + b * c = out", |meta| {
let q = meta.query_selector(self.q_enable);

let a = meta.query_advice(self.value, Rotation::cur());
Expand Down
3 changes: 3 additions & 0 deletions halo2-ecc/src/fields/fp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ pub struct FpChip<'range, F: PrimeField, Fp: PrimeField> {

impl<'range, F: PrimeField, Fp: PrimeField> FpChip<'range, F, Fp> {
pub fn new(range: &'range RangeChip<F>, limb_bits: usize, num_limbs: usize) -> Self {
assert!(limb_bits > 0);
assert!(num_limbs > 0);
assert!(limb_bits <= F::CAPACITY as usize);
let limb_mask = (BigUint::from(1u64) << limb_bits) - 1usize;
let p = modulus::<Fp>();
let p_limbs = decompose_biguint(&p, num_limbs, limb_bits);
Expand Down
4 changes: 2 additions & 2 deletions hashes/zkevm-keccak/src/keccak_packed_multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl<F: FieldExt> CellManager<F> {
// Make sure all rows start at the same column
let width = self.get_width();
#[cfg(debug_assertions)]
for row in self.rows.iter_mut() {
for row in self.rows.iter() {
self.num_unused_cells += width - *row;
}
self.rows = vec![width; self.height];
Expand Down Expand Up @@ -1135,7 +1135,7 @@ impl<F: Field> KeccakCircuitConfig<F> {
for i in 0..5 {
let input = scatter::expr(3, part_size_base) - 2.expr() * input[i].clone()
+ input[(i + 1) % 5].clone()
- input[(i + 2) % 5].clone().clone();
- input[(i + 2) % 5].clone();
let output = output[i].clone();
meta.lookup("chi base", |_| {
vec![(input.clone(), chi_base_table[0]), (output.clone(), chi_base_table[1])]
Expand Down

0 comments on commit 2d2c7ff

Please sign in to comment.