Remove unnecessary if-statement

This commit is contained in:
Mark Spanbroek 2024-01-30 12:07:28 +01:00 committed by markspanbroek
parent 949909fd98
commit 3840e2bf92
1 changed files with 1 additions and 2 deletions

View File

@ -27,8 +27,7 @@ library Pairing {
/// The negation of p, i.e. p.addition(p.negate()) should be zero.
function negate(G1Point memory p) internal pure returns (G1Point memory) {
if (p.x == 0 && p.y == 0) return G1Point(0, 0);
return G1Point(p.x, _Q - (p.y % _Q));
return G1Point(p.x, (_Q - p.y) % _Q);
}
/// The sum of two points of G1