|
|
|
@ -280,25 +280,25 @@ struct Test { |
|
|
|
|
ss >> Q; |
|
|
|
|
CYBOZU_TEST_EQUAL(P, Q); |
|
|
|
|
} |
|
|
|
|
// tight
|
|
|
|
|
// IoEcComp
|
|
|
|
|
if (!Ec::isIoEcCompSupported()) return; |
|
|
|
|
P.set(x, y); |
|
|
|
|
{ |
|
|
|
|
std::string s = P.getStr(mcl::IoTight); |
|
|
|
|
std::string s = P.getStr(mcl::IoEcComp); |
|
|
|
|
CYBOZU_TEST_EQUAL(s.size(), Fp::getByteSize()); |
|
|
|
|
Q.setStr(s, mcl::IoTight); |
|
|
|
|
CYBOZU_TEST_EQUAL(P, Q); |
|
|
|
|
} |
|
|
|
|
{ |
|
|
|
|
P = -P; |
|
|
|
|
std::string s = P.getStr(mcl::IoTight); |
|
|
|
|
std::string s = P.getStr(mcl::IoEcComp); |
|
|
|
|
CYBOZU_TEST_EQUAL(s.size(), Fp::getByteSize()); |
|
|
|
|
Q.setStr(s, mcl::IoTight); |
|
|
|
|
CYBOZU_TEST_EQUAL(P, Q); |
|
|
|
|
} |
|
|
|
|
P.clear(); |
|
|
|
|
{ |
|
|
|
|
std::string s = P.getStr(mcl::IoTight); |
|
|
|
|
std::string s = P.getStr(mcl::IoEcComp); |
|
|
|
|
CYBOZU_TEST_EQUAL(s.size(), Fp::getByteSize()); |
|
|
|
|
CYBOZU_TEST_ASSERT(mcl::fp::isZeroArray(s.c_str(), s.size())); |
|
|
|
|
Q.setStr(s, mcl::IoTight); |
|
|
|
|