diff --git a/misc/Makefile b/misc/Makefile new file mode 100644 index 0000000..1a727f3 --- /dev/null +++ b/misc/Makefile @@ -0,0 +1,6 @@ +all: low_test + +CFLAGS=-I ../include/ -m32 -Ofast -Wall -Wextra -DNDEBUG + +low_test: low_test.cpp + $(CXX) -o low_test low_test.cpp $(CFLAGS) diff --git a/misc/low_test.cpp b/misc/low_test.cpp index 62f84af..856be61 100644 --- a/misc/low_test.cpp +++ b/misc/low_test.cpp @@ -142,10 +142,13 @@ void montTest(const char *pStr) mcl::montT(z, x, y, p); CYBOZU_TEST_EQUAL_ARRAY(z, vz.getUnit(), N); } + CYBOZU_BENCH_C("montT", 10000, mcl::montT, z, x, y, p); } CYBOZU_TEST_AUTO(mont) { - const char *pStr = "0x2523648240000001ba344d80000000086121000000000013a700000000000013"; - montTest<8>(pStr); + const char *pBN254 = "0x2523648240000001ba344d80000000086121000000000013a700000000000013"; + montTest<8>(pBN254); + const char *pBLS12_381 = "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab"; + montTest<12>(pBLS12_381); }