Go to the source code of this file.
◆ affine_pairing_test()
template<typename ppT >
void affine_pairing_test |
( |
| ) |
|
Definition at line 78 of file test_bilinearity.cpp.
79{
81
82 printf(
"Running bilinearity tests:\n");
85
89 Q.print();
91
95
96 printf(
"Pairing bilinearity tests (three must match):\n");
97 GT<ppT> ans1 = ppT::affine_reduced_pairing(sP, Q);
98 GT<ppT> ans2 = ppT::affine_reduced_pairing(
P, sQ);
99 GT<ppT> ans3 = ppT::affine_reduced_pairing(
P, Q)^
s;
100 ans1.print();
101 ans2.print();
102 ans3.print();
103 assert(ans1 == ans2);
104 assert(ans2 == ans3);
105
106 assert(ans1 != GT_one);
109}
LOGGING_API void printf(Category category, const char *format,...)
typename EC_ppT::G1_type G1
typename EC_ppT::Fp_type Fr
typename EC_ppT::GT_type GT
◆ double_miller_loop_test()
template<typename ppT >
void double_miller_loop_test |
( |
| ) |
|
Definition at line 59 of file test_bilinearity.cpp.
60{
65
70
71 const Fqk<ppT> ans_1 = ppT::miller_loop(prec_P1, prec_Q1);
72 const Fqk<ppT> ans_2 = ppT::miller_loop(prec_P2, prec_Q2);
73 const Fqk<ppT> ans_12 = ppT::double_miller_loop(prec_P1, prec_Q1, prec_P2, prec_Q2);
74 assert(ans_1 * ans_2 == ans_12);
75}
typename EC_ppT::Fqk_type Fqk
typename EC_ppT::G1_precomp_type G1_precomp
typename EC_ppT::G2_precomp_type G2_precomp
◆ main()
Definition at line 111 of file test_bilinearity.cpp.
112{
117
122
127
131
132#ifdef CURVE_BN128
136#endif
137}
static void init_public_params()
static void init_public_params()
static void init_public_params()
static void init_public_params()
static void init_public_params()
void affine_pairing_test()
void double_miller_loop_test()
◆ pairing_test()
Definition at line 20 of file test_bilinearity.cpp.
21{
23
24 printf(
"Running bilinearity tests:\n");
26
28
29
32 P.print_coordinates();
34 Q.print();
35 Q.print_coordinates();
37
39
42
43 printf(
"Pairing bilinearity tests (three must match):\n");
44 GT<ppT> ans1 = ppT::reduced_pairing(sP, Q);
45 GT<ppT> ans2 = ppT::reduced_pairing(
P, sQ);
46 GT<ppT> ans3 = ppT::reduced_pairing(
P, Q)^
s;
47 ans1.print();
48 ans2.print();
49 ans3.print();
50 assert(ans1 == ans2);
51 assert(ans2 == ans3);
52
53 assert(ans1 != GT_one);
56}