Skip to content

Commit

Permalink
Fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
nyunyunyunyu committed Aug 21, 2023
1 parent 2daedbe commit bfd7697
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions halo2-base/src/poseidon/hasher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<F: ScalarField, const T: usize, const RATE: usize> PoseidonHasher<F, T, RAT
&self,
ctx: &mut Context<F>,
range: &impl RangeInstructions<F>,
inputs: &Vec<AssignedValue<F>>,
inputs: &[AssignedValue<F>],
len: AssignedValue<F>,
) -> AssignedValue<F>
where
Expand Down Expand Up @@ -204,7 +204,7 @@ impl<F: ScalarField, const T: usize, const RATE: usize> PoseidonSponge<F, T, RAT
fn fix_len_array_squeeze<F: ScalarField, const T: usize, const RATE: usize>(
ctx: &mut Context<F>,
gate: &impl GateInstructions<F>,
input_elements: &Vec<AssignedValue<F>>,
input_elements: &[AssignedValue<F>],
state: &mut PoseidonState<F, T, RATE>,
spec: &OptimizedPoseidonSpec<F, T, RATE>,
) -> AssignedValue<F> {
Expand Down
2 changes: 1 addition & 1 deletion halo2-base/src/poseidon/hasher/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl<F: ScalarField, const T: usize, const RATE: usize> PoseidonState<F, T, RATE
}
}
// If len == 0, inputs_mask is all 0. Then the extra 1 should be added into s[1].
let empty_extra_one = gate.sub(ctx, Constant(F::from(1)), inputs_mask[0]);
let empty_extra_one = gate.not(ctx, inputs_mask[0]);
self.s[1] = gate.add(ctx, self.s[1], empty_extra_one);
}

Expand Down

0 comments on commit bfd7697

Please sign in to comment.