diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-04-02 10:10:29 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-04-02 10:10:29 +0800 |
commit | c20c7610244af8846d9d6a3d6a5be676a7ce92d7 (patch) | |
tree | 835f780487d5c7b50af84010cd9532b0dfe544eb /include | |
parent | 624259deea0c52c54626ac3821c2c47d3e74c599 (diff) | |
download | tangerine-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.hpp | 3 |
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--) { |