|
|
@ -854,9 +854,30 @@ void testHashToFp2v6(const T& mapto) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<class T> |
|
|
|
template<class T> |
|
|
|
void testHashToFp2v7(const T&/* mapto*/) |
|
|
|
void testHashToFp2v7(const T& mapto) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bn::setMapToMode(MCL_MAP_TO_MODE_HASH_TO_CURVE_07); |
|
|
|
bn::setMapToMode(MCL_MAP_TO_MODE_HASH_TO_CURVE_07); |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
const char *msg = "asdf"; |
|
|
|
|
|
|
|
PointStr s = { |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"2525875563870715639912451285996878827057943937903727288399283574780255586622124951113038778168766058972461529282986", |
|
|
|
|
|
|
|
"3132482115871619853374334004070359337604487429071253737901486558733107203612153024147084489564256619439711974285977", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"2106640002084734620850657217129389007976098691731730501862206029008913488613958311385644530040820978748080676977912", |
|
|
|
|
|
|
|
"2882649322619140307052211460282445786973517746532934590265600680988689024512167659295505342688129634612479405019290", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"1", |
|
|
|
|
|
|
|
"0", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
G2 P1, P2; |
|
|
|
|
|
|
|
mapto.msgToG2(P1, msg, strlen(msg)); |
|
|
|
|
|
|
|
set(P2, s); |
|
|
|
|
|
|
|
CYBOZU_TEST_EQUAL(P1, P2); |
|
|
|
|
|
|
|
} |
|
|
|
{ |
|
|
|
{ |
|
|
|
char msg[] = "asdf"; |
|
|
|
char msg[] = "asdf"; |
|
|
|
char dst[] = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; |
|
|
|
char dst[] = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; |
|
|
|