add test of mont12

update-fork
MITSUNARI Shigeo 4 years ago
parent 7dae2ec939
commit e61e56abdf
  1. 6
      misc/Makefile
  2. 7
      misc/low_test.cpp

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

@ -142,10 +142,13 @@ void montTest(const char *pStr)
mcl::montT<N>(z, x, y, p);
CYBOZU_TEST_EQUAL_ARRAY(z, vz.getUnit(), N);
}
CYBOZU_BENCH_C("montT", 10000, mcl::montT<N>, 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);
}

Loading…
Cancel
Save