aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-04-02 10:10:29 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-04-02 10:10:29 +0800
commitc20c7610244af8846d9d6a3d6a5be676a7ce92d7 (patch)
tree835f780487d5c7b50af84010cd9532b0dfe544eb /include
parent624259deea0c52c54626ac3821c2c47d3e74c599 (diff)
downloadtangerine-mcl-c20c7610244af8846d9d6a3d6a5be676a7ce92d7.tar.gz
tangerine-mcl-c20c7610244af8846d9d6a3d6a5be676a7ce92d7.tar.zst
tangerine-mcl-c20c7610244af8846d9d6a3d6a5be676a7ce92d7.zip
bug fix of mulCTrelease20170402
Diffstat (limited to 'include')
-rw-r--r--include/mcl/bn.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/mcl/bn.hpp b/include/mcl/bn.hpp
index 25305b4..2b46cc4 100644
--- a/include/mcl/bn.hpp
+++ b/include/mcl/bn.hpp
@@ -325,13 +325,14 @@ struct GLV {
tbl[3] = A + P; tbl[3].normalize();
Q.clear();
if (constTime) {
+ G1 *pTbl[] = { &tbl[0], &Q, &Q, &Q };
tbl[0] = tbl[1];
for (int i = (int)n - 1; i >= 0; i--) {
G1::dbl(Q, Q);
bool ai = mcl::gmp::testBit(a, i);
bool bi = mcl::gmp::testBit(b, i);
unsigned int c = bi * 2 + ai;
- Q += tbl[c];
+ *pTbl[c] += tbl[c];
}
} else {
for (int i = (int)n - 1; i >= 0; i--) {