From d3f19c82cca60d3654d14ba73641af1ef70f1d64 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Tue, 14 Apr 2020 16:36:09 +0900 Subject: [PATCH] add mapto benchmark --- test/mapto_wb19_test.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/mapto_wb19_test.cpp b/test/mapto_wb19_test.cpp index 30a166b..5e12290 100644 --- a/test/mapto_wb19_test.cpp +++ b/test/mapto_wb19_test.cpp @@ -6,6 +6,7 @@ #include #include #include +#include using namespace mcl; using namespace mcl::bn; @@ -437,6 +438,7 @@ void py_eccTest(const T& mapto) toJacobi(P11, P11); CYBOZU_TEST_EQUAL(P1, P11); py_ecc_hash_to_G2(mapto, P1, msg, msgSize, dst, dstSize); + CYBOZU_BENCH_C("py_ecc_hash_to_G2", 1000, py_ecc_hash_to_G2, mapto, P1, msg, msgSize, dst, dstSize); CYBOZU_TEST_EQUAL(P1, P11); ethMsgToG2(P1, msg, msgSize, dst, dstSize); CYBOZU_TEST_EQUAL(P1, P11); @@ -862,6 +864,7 @@ void testHashToFp2v6(const T& mapto) bn::setMapToMode(MCL_MAP_TO_MODE_HASH_TO_CURVE_06); G2 P; mcl::bn::hashAndMapToG2(P, "asdf", 4); + CYBOZU_BENCH_C("draft06 hashAndMapToG2", 1000, mcl::bn::hashAndMapToG2, P, "asdf", 4); P.normalize(); printf("P=%s %s\n", P.x.getStr(10).c_str(), P.y.getStr(10).c_str()); }