From df3083fe4e90cd7f1d501f37c813cb37f2ff8687 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 11 Oct 2017 14:56:25 +0100 Subject: [PATCH] Remove test code corresponding to removed code --- .../algebra/curves/tests/test_bilinearity.cpp | 17 ------ .../src/algebra/curves/tests/test_groups.cpp | 24 -------- .../src/algebra/fields/tests/test_fields.cpp | 56 ------------------- .../merkle_tree_check_update_gadget.hpp | 1 - .../tests/test_merkle_tree_gadgets.cpp | 14 ----- .../qap/tests/test_qap.cpp | 18 ------ 6 files changed, 130 deletions(-) diff --git a/src/snark/src/algebra/curves/tests/test_bilinearity.cpp b/src/snark/src/algebra/curves/tests/test_bilinearity.cpp index 529bec337..fe6593bae 100644 --- a/src/snark/src/algebra/curves/tests/test_bilinearity.cpp +++ b/src/snark/src/algebra/curves/tests/test_bilinearity.cpp @@ -5,13 +5,10 @@ * @copyright MIT license (see LICENSE file) *****************************************************************************/ #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 "algebra/curves/mnt/mnt4/mnt4_pp.hpp" -#include "algebra/curves/mnt/mnt6/mnt6_pp.hpp" #include @@ -112,20 +109,6 @@ void affine_pairing_test() TEST(algebra, bilinearity) { start_profiling(); - edwards_pp::init_public_params(); - pairing_test(); - double_miller_loop_test(); - - mnt6_pp::init_public_params(); - pairing_test(); - double_miller_loop_test(); - affine_pairing_test(); - - mnt4_pp::init_public_params(); - pairing_test(); - double_miller_loop_test(); - affine_pairing_test(); - alt_bn128_pp::init_public_params(); pairing_test(); double_miller_loop_test(); diff --git a/src/snark/src/algebra/curves/tests/test_groups.cpp b/src/snark/src/algebra/curves/tests/test_groups.cpp index 087ee3d52..7bb7c31cc 100644 --- a/src/snark/src/algebra/curves/tests/test_groups.cpp +++ b/src/snark/src/algebra/curves/tests/test_groups.cpp @@ -5,9 +5,6 @@ * @copyright MIT license (see LICENSE file) *****************************************************************************/ #include "common/profiling.hpp" -#include "algebra/curves/edwards/edwards_pp.hpp" -#include "algebra/curves/mnt/mnt4/mnt4_pp.hpp" -#include "algebra/curves/mnt/mnt6/mnt6_pp.hpp" #ifdef CURVE_BN128 #include "algebra/curves/bn128/bn128_pp.hpp" #endif @@ -139,27 +136,6 @@ void test_output() TEST(algebra, groups) { - edwards_pp::init_public_params(); - test_group >(); - test_output >(); - test_group >(); - test_output >(); - test_mul_by_q >(); - - mnt4_pp::init_public_params(); - test_group >(); - test_output >(); - test_group >(); - test_output >(); - test_mul_by_q >(); - - mnt6_pp::init_public_params(); - test_group >(); - test_output >(); - test_group >(); - test_output >(); - test_mul_by_q >(); - alt_bn128_pp::init_public_params(); test_group >(); test_output >(); diff --git a/src/snark/src/algebra/fields/tests/test_fields.cpp b/src/snark/src/algebra/fields/tests/test_fields.cpp index f4fc3319a..969800d8b 100644 --- a/src/snark/src/algebra/fields/tests/test_fields.cpp +++ b/src/snark/src/algebra/fields/tests/test_fields.cpp @@ -5,9 +5,6 @@ * @copyright MIT license (see LICENSE file) *****************************************************************************/ #include "common/profiling.hpp" -#include "algebra/curves/edwards/edwards_pp.hpp" -#include "algebra/curves/mnt/mnt4/mnt4_pp.hpp" -#include "algebra/curves/mnt/mnt6/mnt6_pp.hpp" #ifdef CURVE_BN128 #include "algebra/curves/bn128/bn128_pp.hpp" #endif @@ -97,45 +94,6 @@ void test_unitary_inverse() EXPECT_EQ(aqcubed_minus1.inverse(), aqcubed_minus1.unitary_inverse()); } -template -void test_cyclotomic_squaring(); - -template<> -void test_cyclotomic_squaring >() -{ - typedef Fqk FieldT; - EXPECT_EQ(FieldT::extension_degree() % 2, 0); - FieldT a = FieldT::random_element(); - FieldT a_unitary = a.Frobenius_map(FieldT::extension_degree()/2) * a.inverse(); - // beta = a^((q^(k/2)-1)*(q+1)) - FieldT beta = a_unitary.Frobenius_map(1) * a_unitary; - EXPECT_EQ(beta.cyclotomic_squared(), beta.squared()); -} - -template<> -void test_cyclotomic_squaring >() -{ - typedef Fqk FieldT; - EXPECT_EQ(FieldT::extension_degree() % 2, 0); - FieldT a = FieldT::random_element(); - FieldT a_unitary = a.Frobenius_map(FieldT::extension_degree()/2) * a.inverse(); - // beta = a^(q^(k/2)-1) - FieldT beta = a_unitary; - EXPECT_EQ(beta.cyclotomic_squared(), beta.squared()); -} - -template<> -void test_cyclotomic_squaring >() -{ - typedef Fqk FieldT; - EXPECT_EQ(FieldT::extension_degree() % 2, 0); - FieldT a = FieldT::random_element(); - FieldT a_unitary = a.Frobenius_map(FieldT::extension_degree()/2) * a.inverse(); - // beta = a^((q^(k/2)-1)*(q+1)) - FieldT beta = a_unitary.Frobenius_map(1) * a_unitary; - EXPECT_EQ(beta.cyclotomic_squared(), beta.squared()); -} - template void test_all_fields() { @@ -220,20 +178,6 @@ void test_Fp4_tom_cook() TEST(algebra, fields) { - edwards_pp::init_public_params(); - test_all_fields(); - test_cyclotomic_squaring >(); - - mnt4_pp::init_public_params(); - test_all_fields(); - test_Fp4_tom_cook(); - test_two_squarings >(); - test_cyclotomic_squaring >(); - - mnt6_pp::init_public_params(); - test_all_fields(); - test_cyclotomic_squaring >(); - alt_bn128_pp::init_public_params(); test_field(); test_Frobenius(); diff --git a/src/snark/src/gadgetlib1/gadgets/merkle_tree/merkle_tree_check_update_gadget.hpp b/src/snark/src/gadgetlib1/gadgets/merkle_tree/merkle_tree_check_update_gadget.hpp index 2d6840d61..6ec0ca11f 100644 --- a/src/snark/src/gadgetlib1/gadgets/merkle_tree/merkle_tree_check_update_gadget.hpp +++ b/src/snark/src/gadgetlib1/gadgets/merkle_tree/merkle_tree_check_update_gadget.hpp @@ -19,7 +19,6 @@ #include "common/data_structures/merkle_tree.hpp" #include "gadgetlib1/gadget.hpp" -#include "gadgetlib1/gadgets/hashes/crh_gadget.hpp" #include "gadgetlib1/gadgets/hashes/hash_io.hpp" #include "gadgetlib1/gadgets/hashes/digest_selector_gadget.hpp" #include "gadgetlib1/gadgets/merkle_tree/merkle_authentication_path_variable.hpp" diff --git a/src/snark/src/gadgetlib1/gadgets/merkle_tree/tests/test_merkle_tree_gadgets.cpp b/src/snark/src/gadgetlib1/gadgets/merkle_tree/tests/test_merkle_tree_gadgets.cpp index 955a05440..5f454687f 100644 --- a/src/snark/src/gadgetlib1/gadgets/merkle_tree/tests/test_merkle_tree_gadgets.cpp +++ b/src/snark/src/gadgetlib1/gadgets/merkle_tree/tests/test_merkle_tree_gadgets.cpp @@ -8,9 +8,6 @@ #ifdef CURVE_BN128 #include "algebra/curves/bn128/bn128_pp.hpp" #endif -#include "algebra/curves/edwards/edwards_pp.hpp" -#include "algebra/curves/mnt/mnt4/mnt4_pp.hpp" -#include "algebra/curves/mnt/mnt6/mnt6_pp.hpp" #include "gadgetlib1/gadgets/merkle_tree/merkle_tree_check_read_gadget.hpp" #include "gadgetlib1/gadgets/merkle_tree/merkle_tree_check_update_gadget.hpp" #include "gadgetlib1/gadgets/hashes/sha256/sha256_gadget.hpp" @@ -23,10 +20,8 @@ template void test_all_merkle_tree_gadgets() { typedef Fr FieldT; - test_merkle_tree_check_read_gadget >(); test_merkle_tree_check_read_gadget >(); - test_merkle_tree_check_update_gadget >(); test_merkle_tree_check_update_gadget >(); } @@ -38,13 +33,4 @@ TEST(gadgetlib1, merkle_tree) bn128_pp::init_public_params(); test_all_merkle_tree_gadgets(); #endif - - edwards_pp::init_public_params(); - test_all_merkle_tree_gadgets(); - - mnt4_pp::init_public_params(); - test_all_merkle_tree_gadgets(); - - mnt6_pp::init_public_params(); - test_all_merkle_tree_gadgets(); } diff --git a/src/snark/src/relations/arithmetic_programs/qap/tests/test_qap.cpp b/src/snark/src/relations/arithmetic_programs/qap/tests/test_qap.cpp index d77662926..2cfa4fc92 100644 --- a/src/snark/src/relations/arithmetic_programs/qap/tests/test_qap.cpp +++ b/src/snark/src/relations/arithmetic_programs/qap/tests/test_qap.cpp @@ -10,7 +10,6 @@ #include #include -#include "algebra/curves/mnt/mnt6/mnt6_pp.hpp" #include "algebra/fields/field_utils.hpp" #include "common/profiling.hpp" #include "common/utils.hpp" @@ -88,30 +87,13 @@ TEST(relations, qap) { start_profiling(); - mnt6_pp::init_public_params(); - const size_t num_inputs = 10; - const size_t basic_domain_size = 1ul< >(basic_domain_size, num_inputs, true); - test_qap >(step_domain_size, num_inputs, true); - test_qap >(extended_domain_size, num_inputs, true); - test_qap >(extended_domain_size_special, num_inputs, true); - leave_block("Test QAP with binary input"); enter_block("Test QAP with field input"); - test_qap >(basic_domain_size, num_inputs, false); - test_qap >(step_domain_size, num_inputs, false); - test_qap >(extended_domain_size, num_inputs, false); - test_qap >(extended_domain_size_special, num_inputs, false); - leave_block("Test QAP with field input"); }