avoid assert if MCL_MAX_BIT_SIZE=256

dev
MITSUNARI Shigeo 7 years ago
parent 29ca8796b0
commit 7dd192c45b
  1. 10
      test/bn_c_test.hpp

@ -131,7 +131,10 @@ CYBOZU_TEST_AUTO(Fr)
CYBOZU_TEST_AUTO(G1)
{
mclBnG1 x, y, z;
memset(&x, 0xff, sizeof(x));
memset(&x, 0x1, sizeof(x));
/*
assert() of carry operation fails if use 0xff, so use 0x1
*/
CYBOZU_TEST_ASSERT(!mclBnG1_isValid(&x));
mclBnG1_clear(&x);
CYBOZU_TEST_ASSERT(mclBnG1_isValid(&x));
@ -171,7 +174,10 @@ CYBOZU_TEST_AUTO(G1)
CYBOZU_TEST_AUTO(G2)
{
mclBnG2 x, y, z;
memset(&x, 0xff, sizeof(x));
/*
assert() of carry operation fails if use 0xff, so use 0x1
*/
memset(&x, 0x1, sizeof(x));
CYBOZU_TEST_ASSERT(!mclBnG2_isValid(&x));
mclBnG2_clear(&x);
CYBOZU_TEST_ASSERT(mclBnG2_isValid(&x));

Loading…
Cancel
Save