From 3e01ff5ca3cc25e8767ecf3c2606eed9ad1fe04a Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Thu, 11 Jun 2015 14:56:22 +0900 Subject: [PATCH] Fp_i is not necessary --- test/ec_test.cpp | 20 +++++++------------- test/elgamal_test.cpp | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/test/ec_test.cpp b/test/ec_test.cpp index e3f398d..c143376 100644 --- a/test/ec_test.cpp +++ b/test/ec_test.cpp @@ -5,20 +5,16 @@ #include #include -typedef mcl::FpT<> Fp_3; -typedef mcl::FpT<> Fp_4; -typedef mcl::FpT<> Fp_6; -typedef mcl::FpT<> Fp_9; #include #include #include +typedef mcl::FpT<> Fp; struct tagZn; typedef mcl::FpT Zn; +typedef mcl::EcT Ec; -template struct Test { - typedef mcl::EcT Ec; const mcl::EcParam& para; Test(const mcl::EcParam& para) : para(para) @@ -26,7 +22,6 @@ struct Test { Fp::setModulo(para.p); Zn::setModulo(para.n); Ec::setParam(para.a, para.b); -// CYBOZU_TEST_EQUAL(para.bitSize, Fp(-1).getBitSize()); } void cstr() const { @@ -274,12 +269,11 @@ private: void operator=(const Test&); }; -template void test_sub(const mcl::EcParam *para, size_t paraNum) { for (size_t i = 0; i < paraNum; i++) { puts(para[i].name); - Test(para[i]).run(); + Test(para[i]).run(); } } @@ -299,7 +293,7 @@ CYBOZU_TEST_AUTO(all) mcl::ecparam::secp192k1, mcl::ecparam::NIST_P192, }; - test_sub(para3, CYBOZU_NUM_OF_ARRAY(para3)); + test_sub(para3, CYBOZU_NUM_OF_ARRAY(para3)); } if (g_partial & (1 << 4)) { @@ -309,7 +303,7 @@ CYBOZU_TEST_AUTO(all) mcl::ecparam::NIST_P224, mcl::ecparam::NIST_P256, }; - test_sub(para4, CYBOZU_NUM_OF_ARRAY(para4)); + test_sub(para4, CYBOZU_NUM_OF_ARRAY(para4)); } if (g_partial & (1 << 6)) { @@ -317,7 +311,7 @@ CYBOZU_TEST_AUTO(all) // mcl::ecparam::secp384r1, mcl::ecparam::NIST_P384, }; - test_sub(para6, CYBOZU_NUM_OF_ARRAY(para6)); + test_sub(para6, CYBOZU_NUM_OF_ARRAY(para6)); } if (g_partial & (1 << 9)) { @@ -325,7 +319,7 @@ CYBOZU_TEST_AUTO(all) // mcl::ecparam::secp521r1, mcl::ecparam::NIST_P521, }; - test_sub(para9, CYBOZU_NUM_OF_ARRAY(para9)); + test_sub(para9, CYBOZU_NUM_OF_ARRAY(para9)); } } diff --git a/test/elgamal_test.cpp b/test/elgamal_test.cpp index e0920c9..36b702f 100644 --- a/test/elgamal_test.cpp +++ b/test/elgamal_test.cpp @@ -22,7 +22,7 @@ CYBOZU_TEST_AUTO(testEc) Ec::setParam(para.a, para.b); const Fp x0(para.gx); const Fp y0(para.gy); - const size_t bitSize = Zn(-1).getBitSize(); + const size_t bitSize = Zn::getBitSize(); const Ec P(x0, y0); /* Zn =