From bb4735dddc22458abacc4ac9714df79e3aff13ba Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Wed, 26 Sep 2018 08:47:54 +0900 Subject: [PATCH] add Ec::operator* and Ec::operator*= --- include/mcl/ec.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/mcl/ec.hpp b/include/mcl/ec.hpp index ec46602..8ebf7e7 100644 --- a/include/mcl/ec.hpp +++ b/include/mcl/ec.hpp @@ -866,8 +866,12 @@ public: } inline friend EcT operator+(const EcT& x, const EcT& y) { EcT z; add(z, x, y); return z; } inline friend EcT operator-(const EcT& x, const EcT& y) { EcT z; sub(z, x, y); return z; } + template + inline friend EcT operator*(const EcT& x, const INT& y) { EcT z; mul(z, x, y); return z; } EcT& operator+=(const EcT& x) { add(*this, *this, x); return *this; } EcT& operator-=(const EcT& x) { sub(*this, *this, x); return *this; } + template + EcT& operator*=(const INT& x) { mul(*this, *this, x); return *this; } EcT operator-() const { EcT x; neg(x, *this); return x; } bool operator==(const EcT& rhs) const {