diff --git a/include/mcl/ec.hpp b/include/mcl/ec.hpp index ad1c749..6a6c9b7 100644 --- a/include/mcl/ec.hpp +++ b/include/mcl/ec.hpp @@ -693,12 +693,15 @@ public: sub(R, *this, rhs); // QQQ : optimized later return R.isZero(); } + bool operator!=(const EcT& rhs) const { return !operator==(rhs); } bool operator<(const EcT& rhs) const { if (isZero()) { return !rhs.isZero(); } if (rhs.isZero()) return false; + normalize(); + rhs.normalize(); int cmp = Fp::compare(x, rhs.x); if (cmp < 0) return true; if (cmp > 0) return false; @@ -707,7 +710,6 @@ public: bool operator>=(const EcT& rhs) const { return !operator<(rhs); } bool operator>(const EcT& rhs) const { return rhs < *this; } bool operator<=(const EcT& rhs) const { return !operator>(rhs); } - bool operator!=(const EcT& rhs) const { return !operator==(rhs); } private: static inline void mulArray(EcT& z, const EcT& x, const fp::Unit *y, size_t yn, bool isNegative) {