1 # Exercises a bug found by Zhang Ye.
3 define test_cmp_0(initfn) {
5 CHECK(random(G2) != G2(0));
6 CHECK(G2(0) != random(G2));
8 CHECK(random(G1) != G1(0));
9 CHECK(G1(0) != random(G1));
10 CHECK(G1(0) == G1(0));
13 test_cmp_0(init_pairing_a);
14 test_cmp_0(init_pairing_d);
15 test_cmp_0(init_pairing_e);
16 test_cmp_0(init_pairing_f);
17 test_cmp_0(init_pairing_g);
18 test_cmp_0(init_pairing_i);
20 # Exercises a bug found by Mario Di Raimondo.
22 define test_g2_cmp(initfn) {
27 CHECK((a^m)^n == a^(m*n));
32 test_g2_cmp(init_pairing_a);
33 test_g2_cmp(init_pairing_d);
34 test_g2_cmp(init_pairing_e);
35 test_g2_cmp(init_pairing_f);
36 test_g2_cmp(init_pairing_g);
37 test_g2_cmp(init_pairing_i);