diff --git a/include/mcl/bn.h b/include/mcl/bn.h index 08174ce..03756c5 100644 --- a/include/mcl/bn.h +++ b/include/mcl/bn.h @@ -94,8 +94,7 @@ typedef struct { } mclBnFp; typedef struct { - mclBnFp a; - mclBnFp b; + mclBnFp d[2]; } mclBnFp2; #endif diff --git a/test/bn_c_test.hpp b/test/bn_c_test.hpp index f4fc79a..d6926a4 100644 --- a/test/bn_c_test.hpp +++ b/test/bn_c_test.hpp @@ -592,9 +592,9 @@ CYBOZU_TEST_AUTO(Fp2) { mclBnFp2 x1, x2; char buf[1024]; - int ret = mclBnFp_setHashOf(&x1.a, "abc", 3); + int ret = mclBnFp_setHashOf(&x1.d[0], "abc", 3); CYBOZU_TEST_ASSERT(ret == 0); - ret = mclBnFp_setHashOf(&x1.b, "xyz", 3); + ret = mclBnFp_setHashOf(&x1.d[1], "xyz", 3); CYBOZU_TEST_ASSERT(ret == 0); mclSize n = mclBnFp2_serialize(buf, sizeof(buf), &x1); CYBOZU_TEST_ASSERT(n > 0); @@ -621,8 +621,8 @@ CYBOZU_TEST_AUTO(mapToG2) { mclBnFp2 x; mclBnG2 P1, P2; - mclBnFp_setHashOf(&x.a, "abc", 3); - mclBnFp_clear(&x.b); + mclBnFp_setHashOf(&x.d[0], "abc", 3); + mclBnFp_clear(&x.d[1]); int ret = mclBnFp2_mapToG2(&P1, &x); CYBOZU_TEST_ASSERT(ret == 0); mclBnG2_hashAndMapTo(&P2, "abc", 3);