Skip to content

Commit

Permalink
Use is_zero().
Browse files Browse the repository at this point in the history
  • Loading branch information
acoglio committed Dec 27, 2023
1 parent 15e5ccc commit 66a5654
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion circuit/types/field/src/square_root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl<E: Environment> Field<E> {
let second_root = first_root.clone().neg();

// The error flag is set iff self is a non-square, i.e. it is neither zero nor a non-zero square.
let is_nonzero = self.is_not_equal(&Field::zero());
let is_nonzero = !self.is_zero();
let error_flag = is_nonzero.bitand(is_nonzero_square.not());

(error_flag, first_root, second_root)
Expand Down
4 changes: 2 additions & 2 deletions circuit/types/group/src/helpers/from_x_coordinate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ impl<E: Environment> Group<E> {
}
let point1_times_order = order_bits_be_constants.mul(point1);
let point2_times_order = order_bits_be_constants.mul(point2);
let point1_is_in_subgroup = point1_times_order.is_equal(&Self::zero());
let point2_is_in_subgroup = point2_times_order.is_equal(&Self::zero());
let point1_is_in_subgroup = point1_times_order.is_zero();
let point2_is_in_subgroup = point2_times_order.is_zero();

// We select y1 if (x, y1) is in the subgroup (which implies that (x, y2) is not in the subgroup),
// or y2 if (x, y2) is in the subgroup (which implies that (x, y1) is not in the subgroup),
Expand Down

0 comments on commit 66a5654

Please sign in to comment.