show curve name on bench

dev
MITSUNARI Shigeo 8 years ago
parent abf59abc4e
commit c03f944f1a
  1. 7
      test/bn384_test.cpp
  2. 4
      test/bn_test.cpp

@ -43,10 +43,13 @@ void testCurve(const mcl::bn::CurveParam& cp)
CYBOZU_TEST_AUTO(pairing)
{
testCurve(mcl::bn::CurveFp382_1);
testCurve(mcl::bn::CurveFp382_2);
puts("CurveFp254BNb");
// support 256-bit pairing
testCurve(mcl::bn::CurveFp254BNb);
puts("CurveFp382_1");
testCurve(mcl::bn::CurveFp382_1);
puts("CurveFp382_2");
testCurve(mcl::bn::CurveFp382_2);
}
int main(int argc, char *argv[])

@ -14,6 +14,7 @@ mcl::fp::Mode g_mode;
const struct TestSet {
mcl::bn::CurveParam cp;
const char *name;
struct G2 {
const char *aa;
const char *ab;
@ -28,6 +29,7 @@ const struct TestSet {
} g_testSetTbl[] = {
{
mcl::bn::CurveFp254BNb,
"CurveFp254BNb",
{
"12723517038133731887338407189719511622662176727675373276651903807414909099441",
"4168783608814932154536427934509895782246573715297911553964171371032945126671",
@ -52,6 +54,7 @@ const struct TestSet {
},
{
mcl::bn::CurveSNARK1,
"CurveSNARK1",
{
"15267802884793550383558706039165621050290089775961208824303765753922461897946",
"9034493566019742339402378670461897774509967669562610788113215988055021632533",
@ -311,6 +314,7 @@ CYBOZU_TEST_AUTO(naive)
{
for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(g_testSetTbl); i++) {
const TestSet& ts = g_testSetTbl[i];
printf("curve=%s\n", ts.name);
bn256init(ts.cp, g_mode);
G1 P(ts.g1.a, ts.g1.b);
G2 Q(Fp2(ts.g2.aa, ts.g2.ab), Fp2(ts.g2.ba, ts.g2.bb));

Loading…
Cancel
Save