at first modulo

dev
MITSUNARI Shigeo 8 years ago
parent 9b63aca0ad
commit 682c294ffa
  1. 2
      include/mcl/bn.hpp

@ -257,6 +257,7 @@ struct GLV {
} }
void mul(G1& Q, G1 P, mpz_class x) const void mul(G1& Q, G1 P, mpz_class x) const
{ {
x %= r;
if (x == 0) { if (x == 0) {
Q.clear(); Q.clear();
return; return;
@ -265,7 +266,6 @@ struct GLV {
G1::neg(P, P); G1::neg(P, P);
x = -x; x = -x;
} }
x %= r;
mpz_class a, b; mpz_class a, b;
getAB(a, b, x); getAB(a, b, x);
// Q = (ap^2 + b)P // Q = (ap^2 + b)P

Loading…
Cancel
Save