diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index ed7364a6df..d6abc7b09e 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -119,7 +119,7 @@ impl Field { 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) diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index 1a6c4a0f6c..42bb31352f 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -78,8 +78,8 @@ impl Group { } 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),