aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2019-03-22 13:45:17 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2019-03-22 13:45:17 +0800
commitf3f9be495c6a9c37340e7fe4879b945afc060c92 (patch)
tree4032447952b63c30a6a40f2bfffa94ea51f03a8a
parent1b56502258508217ec95cd4d2d2d9b0a751f9938 (diff)
downloadtangerine-mcl-f3f9be495c6a9c37340e7fe4879b945afc060c92.tar.gz
tangerine-mcl-f3f9be495c6a9c37340e7fe4879b945afc060c92.tar.zst
tangerine-mcl-f3f9be495c6a9c37340e7fe4879b945afc060c92.zip
shortcut for Ec::mul(Px, P, x) if P = 0v0.92
-rw-r--r--include/mcl/ec.hpp4
-rw-r--r--include/mcl/op.hpp2
-rw-r--r--readme.md1
3 files changed, 6 insertions, 1 deletions
diff --git a/include/mcl/ec.hpp b/include/mcl/ec.hpp
index 840fa01..b8eb10b 100644
--- a/include/mcl/ec.hpp
+++ b/include/mcl/ec.hpp
@@ -910,6 +910,10 @@ public:
bool operator<=(const EcT& rhs) const { return !operator>(rhs); }
static inline void mulArray(EcT& z, const EcT& x, const fp::Unit *y, size_t yn, bool isNegative, bool constTime = false)
{
+ if (!constTime && x.isZero()) {
+ z.clear();
+ return;
+ }
if (mulArrayGLV && (constTime || yn > 1)) {
mulArrayGLV(z, x, y, yn, isNegative, constTime);
return;
diff --git a/include/mcl/op.hpp b/include/mcl/op.hpp
index 549d93b..36d3703 100644
--- a/include/mcl/op.hpp
+++ b/include/mcl/op.hpp
@@ -26,7 +26,7 @@
namespace mcl {
-static const int version = 0x091; /* 0xABC = A.BC */
+static const int version = 0x092; /* 0xABC = A.BC */
/*
specifies available string format mode for X::setIoMode()
diff --git a/readme.md b/readme.md
index 04d2ef3..8bd56f0 100644
--- a/readme.md
+++ b/readme.md
@@ -443,6 +443,7 @@ Y. Sakemi, Y. Nogami, K. Okeya, Y. Morikawa, CANS 2008.
# History
+* 2019/Mar/22 v0.92 shortcut for Ec::mul(Px, P, x) if P = 0
* 2019/Mar/21 python binding of she256 for Linux/Mac/Windows
* 2019/Mar/14 v0.91 modp supports mcl-wasm
* 2019/Mar/12 v0.90 fix Vint::setArray(x) for x == this