aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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
Diffstat (limited to 'include')
-rw-r--r--include/mcl/ec.hpp4
-rw-r--r--include/mcl/op.hpp2
2 files changed, 5 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()