aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2018-09-26 07:47:54 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2018-09-26 07:47:54 +0800
commitbb4735dddc22458abacc4ac9714df79e3aff13ba (patch)
tree977c3fe2ebf3082f6e498b5b43f2b23db070c5f5
parentdc8d43f5ad0a4d1983ee84f6baa0c2ca9a467b3e (diff)
downloadtangerine-mcl-bb4735dddc22458abacc4ac9714df79e3aff13ba.tar.gz
tangerine-mcl-bb4735dddc22458abacc4ac9714df79e3aff13ba.tar.zst
tangerine-mcl-bb4735dddc22458abacc4ac9714df79e3aff13ba.zip
add Ec::operator* and Ec::operator*=
-rw-r--r--include/mcl/ec.hpp4
1 files changed, 4 insertions, 0 deletions
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<class INT>
+ 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<class INT>
+ 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
{