change members of mclBnFp2

pull/2/head
MITSUNARI Shigeo 6 years ago
parent 5b4abee36f
commit a6ccd705fc
  1. 3
      include/mcl/bn.h
  2. 8
      test/bn_c_test.hpp

@ -94,8 +94,7 @@ typedef struct {
} mclBnFp;
typedef struct {
mclBnFp a;
mclBnFp b;
mclBnFp d[2];
} mclBnFp2;
#endif

@ -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);

Loading…
Cancel
Save