Skip to content

Commit

Permalink
Merge pull request #4191 from randombit/jack/pcurves-is-even-ct
Browse files Browse the repository at this point in the history
Avoid a potentially troublesome construct in pcurves is_even
  • Loading branch information
randombit authored Jul 10, 2024
2 parents d14ca95 + 2866ee3 commit 69a51e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/math/pcurves/pcurves_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class IntMod final {

constexpr CT::Choice is_even() const {
auto v = Rep::from_rep(m_val);
return CT::Choice::from_int(0x01 ^ (v[0] & 0x01));
return !CT::Choice::from_int(v[0] & 0x01);
}

friend constexpr Self operator+(const Self& a, const Self& b) {
Expand Down

0 comments on commit 69a51e9

Please sign in to comment.