fix testCompress ; a must be in GT

dev
MITSUNARI Shigeo 7 years ago
parent 3466380d24
commit 9d2774a391
  1. 8
      test/bn_test.cpp

@ -166,13 +166,11 @@ void testCyclotomic()
CYBOZU_TEST_EQUAL(a, d); CYBOZU_TEST_EQUAL(a, d);
} }
void testCompress() void testCompress(const G1& P, const G2& Q)
{ {
if (!BN::param.isCurveFp254BNb) return; if (!BN::param.isCurveFp254BNb) return;
Fp12 a; Fp12 a;
for (int i = 0; i < 12; ++i) { BN::pairing(a, P, Q);
a.getFp0()[i] = i;
}
BN::mapToCyclotomic(a, a); BN::mapToCyclotomic(a, a);
Fp12 b; Fp12 b;
Compress::fixed_power(b, a); Compress::fixed_power(b, a);
@ -380,7 +378,7 @@ CYBOZU_TEST_AUTO(naive)
testMapToG1(); testMapToG1();
testMapToG2(); testMapToG2();
testCyclotomic(); testCyclotomic();
testCompress(); testCompress(P, Q);
testPairing(P, Q, ts.e); testPairing(P, Q, ts.e);
testPrecomputed(P, Q); testPrecomputed(P, Q);
testMillerLoop2(P, Q); testMillerLoop2(P, Q);

Loading…
Cancel
Save