From f3f9be495c6a9c37340e7fe4879b945afc060c92 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Fri, 22 Mar 2019 14:45:17 +0900 Subject: [PATCH] shortcut for Ec::mul(Px, P, x) if P = 0 --- include/mcl/ec.hpp | 4 ++++ include/mcl/op.hpp | 2 +- readme.md | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) 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