aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-03-28 04:10:59 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-03-28 04:10:59 +0800
commit682c294ffae563177daf2b18cfcc7c65ac558d94 (patch)
treebf529a61d621284c738de963cb579b861a93ab92
parent9b63aca0addf7415ff1af6bd4d6d7d77ec13d156 (diff)
downloaddexon-mcl-682c294ffae563177daf2b18cfcc7c65ac558d94.tar.gz
dexon-mcl-682c294ffae563177daf2b18cfcc7c65ac558d94.tar.zst
dexon-mcl-682c294ffae563177daf2b18cfcc7c65ac558d94.zip
at first modulo
-rw-r--r--include/mcl/bn.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mcl/bn.hpp b/include/mcl/bn.hpp
index b99b006..aba9be4 100644
--- a/include/mcl/bn.hpp
+++ b/include/mcl/bn.hpp
@@ -257,6 +257,7 @@ struct GLV {
}
void mul(G1& Q, G1 P, mpz_class x) const
{
+ x %= r;
if (x == 0) {
Q.clear();
return;
@@ -265,7 +266,6 @@ struct GLV {
G1::neg(P, P);
x = -x;
}
- x %= r;
mpz_class a, b;
getAB(a, b, x);
// Q = (ap^2 + b)P