diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-06-24 06:13:53 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-06-24 06:13:53 +0800 |
commit | 524aee984073eba487d86f203440c77b943b3f72 (patch) | |
tree | 4da9e84deb5b12b0728ebdc712070effa6c5b43a | |
parent | 14251e855ef02258aa4cb9c3fe8f35ea7c69481f (diff) | |
download | dexon-mcl-524aee984073eba487d86f203440c77b943b3f72.tar.gz dexon-mcl-524aee984073eba487d86f203440c77b943b3f72.tar.zst dexon-mcl-524aee984073eba487d86f203440c77b943b3f72.zip |
test for MCL_MAX_BIT_SIZE=384
-rw-r--r-- | test/ec_test.cpp | 4 | ||||
-rw-r--r-- | test/fp_test.cpp | 6 | ||||
-rw-r--r-- | test/mont_fp_test.cpp | 6 |
3 files changed, 15 insertions, 1 deletions
diff --git a/test/ec_test.cpp b/test/ec_test.cpp index c8c079c..171a912 100644 --- a/test/ec_test.cpp +++ b/test/ec_test.cpp @@ -466,6 +466,7 @@ CYBOZU_TEST_AUTO(all) test_sub(para4, CYBOZU_NUM_OF_ARRAY(para4)); } +#if MCL_MAX_BIT_SIZE >= 384 if (g_partial & (1 << 6)) { const struct mcl::EcParam para6[] = { // mcl::ecparam::secp384r1, @@ -473,7 +474,9 @@ CYBOZU_TEST_AUTO(all) }; test_sub(para6, CYBOZU_NUM_OF_ARRAY(para6)); } +#endif +#if MCL_MAX_BIT_SIZE >= 521 if (g_partial & (1 << 9)) { const struct mcl::EcParam para9[] = { // mcl::ecparam::secp521r1, @@ -481,6 +484,7 @@ CYBOZU_TEST_AUTO(all) }; test_sub(para9, CYBOZU_NUM_OF_ARRAY(para9)); } +#endif } int main(int argc, char *argv[]) diff --git a/test/fp_test.cpp b/test/fp_test.cpp index efda750..1070eee 100644 --- a/test/fp_test.cpp +++ b/test/fp_test.cpp @@ -757,7 +757,7 @@ CYBOZU_TEST_AUTO(getArray) #include <iostream> -#if defined(MCL_USE_LLVM) || defined(MCL_USE_XBYAK) +#if (defined(MCL_USE_LLVM) || defined(MCL_USE_XBYAK)) && (MCL_MAX_BIT_SIZE >= 521) CYBOZU_TEST_AUTO(mod_NIST_P521) { const size_t len = 521; @@ -828,12 +828,16 @@ void sub(mcl::fp::Mode mode) "0x7523648240000001ba344d80000000086121000000000013a700000000000017", "0x800000000000000000000000000000000000000000000000000000000000005f", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff43", // max prime +#if MCL_MAX_BIT_SIZE >= 384 // N = 6 "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", +#endif +#if MCL_MAX_BIT_SIZE >= 521 // N = 9 "0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", +#endif }; for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(tbl); i++) { const char *pStr = tbl[i]; diff --git a/test/mont_fp_test.cpp b/test/mont_fp_test.cpp index b26f828..0cb8340 100644 --- a/test/mont_fp_test.cpp +++ b/test/mont_fp_test.cpp @@ -185,6 +185,7 @@ put(z); #endif } +#if MCL_MAX_BIT_SIZE >= 521 CYBOZU_TEST_AUTO(customTest) { const struct { @@ -204,6 +205,7 @@ CYBOZU_TEST_AUTO(customTest) customTest(tbl[i].p, tbl[i].x, tbl[i].y); } } +#endif CYBOZU_TEST_AUTO(test) { @@ -234,11 +236,15 @@ CYBOZU_TEST_AUTO(test) "0x800000000000000000000000000000000000000000000000000000000000005f", "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff43", // max prime +#if MCL_MAX_BIT_SIZE >= 384 // N = 6 "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", +#endif +#if MCL_MAX_BIT_SIZE >= 521 // N = 9 "0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", +#endif }; for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(tbl); i++) { printf("prime=%s\n", tbl[i]); |