From 13d9500f3f9ac721fe186abdd7d74da5fb1dec9b Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Fri, 6 Sep 2019 22:17:58 +0900 Subject: [PATCH] Ec::mulSmallInt errors if negative --- include/mcl/ec.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mcl/ec.hpp b/include/mcl/ec.hpp index 7ff7e8a..708b854 100644 --- a/include/mcl/ec.hpp +++ b/include/mcl/ec.hpp @@ -994,7 +994,7 @@ 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 && yn == 1 && *y <= 16) { + if (!constTime && yn == 1 && *y <= 16 && !isNegative) { if (mulSmallInt(z, x, static_cast(*y), isNegative)) return; } if (mulArrayGLV && (constTime || yn > 1)) {