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