aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-06-29 13:33:29 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-06-29 13:33:33 +0800
commitf9c543eab5e5f80187da650fe937ce8d04d7624a (patch)
tree563baf15ee04b41fffc28b7e489f5da35cd741f2
parent8bf97f8cc55f162b4b37e65e4dd0b24df5f70856 (diff)
downloaddexon-mcl-f9c543eab5e5f80187da650fe937ce8d04d7624a.tar.gz
dexon-mcl-f9c543eab5e5f80187da650fe937ce8d04d7624a.tar.zst
dexon-mcl-f9c543eab5e5f80187da650fe937ce8d04d7624a.zip
add Ec::getIoMode
-rw-r--r--include/mcl/ec.hpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/mcl/ec.hpp b/include/mcl/ec.hpp
index b22ac3c..c829812 100644
--- a/include/mcl/ec.hpp
+++ b/include/mcl/ec.hpp
@@ -704,8 +704,7 @@ public:
}
friend inline std::ostream& operator<<(std::ostream& os, const EcT& self)
{
- int ioMode = fp::detectIoMode(Fp::BaseFp::getIoMode(), os);
- ioMode |= ioMode_;
+ int ioMode = fp::detectIoMode(getIoMode(), os);
return os << self.getStr(ioMode);
}
std::istream& readStream(std::istream& is, int ioMode)
@@ -761,8 +760,7 @@ public:
}
friend inline std::istream& operator>>(std::istream& is, EcT& self)
{
- int ioMode = fp::detectIoMode(Fp::BaseFp::getIoMode(), os);
- ioMode |= ioMode_;
+ int ioMode = fp::detectIoMode(getIoMode(), is);
return self.readStream(is, ioMode);
}
void setStr(const std::string& str, int ioMode = 0)
@@ -787,6 +785,7 @@ public:
if (ioMode & 0xff) throw cybozu::Exception("EcT:setIoMode:use Fp::setIomode") << ioMode;
ioMode_ = ioMode;
}
+ static inline int getIoMode() { return Fp::getIoMode() | ioMode_; }
static inline void getWeierstrass(Fp& yy, const Fp& x)
{
Fp t;