diff --git a/include/mcl/ec.hpp b/include/mcl/ec.hpp index e0eb2e8..c57f1c3 100644 --- a/include/mcl/ec.hpp +++ b/include/mcl/ec.hpp @@ -98,10 +98,10 @@ public: } #endif } - static inline void setParam(const std::string& astr, const std::string& bstr, int mode = ec::Jacobi) + static inline void setParam(const Fp& a, const Fp& b, int mode = ec::Jacobi) { - a_.setStr(astr); - b_.setStr(bstr); + a_ = a; + b_ = b; if (a_.isZero()) { specialA_ = zero; } else if (a_ == -3) { @@ -122,6 +122,10 @@ public: } #endif } + static inline void setParam(const std::string& astr, const std::string& bstr, int mode = ec::Jacobi) + { + setParam(Fp(astr), Fp(bstr), mode); + } static inline bool isValid(const Fp& _x, const Fp& _y) { return _y * _y == (_x * _x + a_) * _x + b_;