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