]> Git Repo - VerusCoin.git/blobdiff - src/snark/libsnark/algebra/curves/tests/test_bilinearity.cpp
src/snark patches for windows build
[VerusCoin.git] / src / snark / libsnark / algebra / curves / tests / test_bilinearity.cpp
index fe6593baeef9a34d25f576d5aaf66440d734e977..18e68f7bb1abdfa9d8ae98f7d9ada44a7f0eb80c 100644 (file)
@@ -4,13 +4,17 @@
  *             and contributors (see AUTHORS).
  * @copyright  MIT license (see LICENSE file)
  *****************************************************************************/
+#include <iostream>
 #include "common/profiling.hpp"
+//#include "algebra/curves/edwards/edwards_pp.hpp"
 #ifdef CURVE_BN128
 #include "algebra/curves/bn128/bn128_pp.hpp"
 #endif
 #include "algebra/curves/alt_bn128/alt_bn128_pp.hpp"
-
-#include <gtest/gtest.h>
+//#include "algebra/curves/mnt/mnt4/mnt4_pp.hpp"
+//#include "algebra/curves/mnt/mnt6/mnt6_pp.hpp"
+#include "algebra/curves/alt_bn128/alt_bn128_pairing.hpp"
+#include "algebra/curves/alt_bn128/alt_bn128_pairing.cpp"
 
 using namespace libsnark;
 
@@ -45,11 +49,11 @@ void pairing_test()
     ans1.print();
     ans2.print();
     ans3.print();
-    EXPECT_EQ(ans1, ans2);
-    EXPECT_EQ(ans2, ans3);
+    assert(ans1 == ans2);
+    assert(ans2 == ans3);
 
-    EXPECT_NE(ans1, GT_one);
-    EXPECT_EQ((ans1^Fr<ppT>::field_char()), GT_one);
+    assert(ans1 != GT_one);
+    assert((ans1^Fr<ppT>::field_char()) == GT_one);
     printf("\n\n");
 }
 
@@ -69,7 +73,7 @@ void double_miller_loop_test()
     const Fqk<ppT> ans_1 = ppT::miller_loop(prec_P1, prec_Q1);
     const Fqk<ppT> ans_2 = ppT::miller_loop(prec_P2, prec_Q2);
     const Fqk<ppT> ans_12 = ppT::double_miller_loop(prec_P1, prec_Q1, prec_P2, prec_Q2);
-    EXPECT_EQ(ans_1 * ans_2, ans_12);
+    assert(ans_1 * ans_2 == ans_12);
 }
 
 template<typename ppT>
@@ -98,17 +102,31 @@ void affine_pairing_test()
     ans1.print();
     ans2.print();
     ans3.print();
-    EXPECT_EQ(ans1, ans2);
-    EXPECT_EQ(ans2, ans3);
+    assert(ans1 == ans2);
+    assert(ans2 == ans3);
 
-    EXPECT_NE(ans1, GT_one);
-    EXPECT_EQ((ans1^Fr<ppT>::field_char()), GT_one);
+    assert(ans1 != GT_one);
+    assert((ans1^Fr<ppT>::field_char()) == GT_one);
     printf("\n\n");
 }
 
-TEST(algebra, bilinearity)
+int main(void)
 {
     start_profiling();
+    edwards_pp::init_public_params();
+    pairing_test<edwards_pp>();
+    double_miller_loop_test<edwards_pp>();
+
+    mnt6_pp::init_public_params();
+    pairing_test<mnt6_pp>();
+    double_miller_loop_test<mnt6_pp>();
+    affine_pairing_test<mnt6_pp>();
+
+    mnt4_pp::init_public_params();
+    pairing_test<mnt4_pp>();
+    double_miller_loop_test<mnt4_pp>();
+    affine_pairing_test<mnt4_pp>();
+
     alt_bn128_pp::init_public_params();
     pairing_test<alt_bn128_pp>();
     double_miller_loop_test<alt_bn128_pp>();
This page took 0.025843 seconds and 4 git commands to generate.