Remove test code corresponding to removed code

This commit is contained in:
Jack Grigg 2017-10-11 14:56:25 +01:00
parent 054ae60645
commit df3083fe4e
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
6 changed files with 0 additions and 130 deletions

View File

@ -5,13 +5,10 @@
* @copyright MIT license (see LICENSE file) * @copyright MIT license (see LICENSE file)
*****************************************************************************/ *****************************************************************************/
#include "common/profiling.hpp" #include "common/profiling.hpp"
#include "algebra/curves/edwards/edwards_pp.hpp"
#ifdef CURVE_BN128 #ifdef CURVE_BN128
#include "algebra/curves/bn128/bn128_pp.hpp" #include "algebra/curves/bn128/bn128_pp.hpp"
#endif #endif
#include "algebra/curves/alt_bn128/alt_bn128_pp.hpp" #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 <gtest/gtest.h> #include <gtest/gtest.h>
@ -112,20 +109,6 @@ void affine_pairing_test()
TEST(algebra, bilinearity) TEST(algebra, bilinearity)
{ {
start_profiling(); 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(); alt_bn128_pp::init_public_params();
pairing_test<alt_bn128_pp>(); pairing_test<alt_bn128_pp>();
double_miller_loop_test<alt_bn128_pp>(); double_miller_loop_test<alt_bn128_pp>();

View File

@ -5,9 +5,6 @@
* @copyright MIT license (see LICENSE file) * @copyright MIT license (see LICENSE file)
*****************************************************************************/ *****************************************************************************/
#include "common/profiling.hpp" #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 #ifdef CURVE_BN128
#include "algebra/curves/bn128/bn128_pp.hpp" #include "algebra/curves/bn128/bn128_pp.hpp"
#endif #endif
@ -139,27 +136,6 @@ void test_output()
TEST(algebra, groups) TEST(algebra, groups)
{ {
edwards_pp::init_public_params();
test_group<G1<edwards_pp> >();
test_output<G1<edwards_pp> >();
test_group<G2<edwards_pp> >();
test_output<G2<edwards_pp> >();
test_mul_by_q<G2<edwards_pp> >();
mnt4_pp::init_public_params();
test_group<G1<mnt4_pp> >();
test_output<G1<mnt4_pp> >();
test_group<G2<mnt4_pp> >();
test_output<G2<mnt4_pp> >();
test_mul_by_q<G2<mnt4_pp> >();
mnt6_pp::init_public_params();
test_group<G1<mnt6_pp> >();
test_output<G1<mnt6_pp> >();
test_group<G2<mnt6_pp> >();
test_output<G2<mnt6_pp> >();
test_mul_by_q<G2<mnt6_pp> >();
alt_bn128_pp::init_public_params(); alt_bn128_pp::init_public_params();
test_group<G1<alt_bn128_pp> >(); test_group<G1<alt_bn128_pp> >();
test_output<G1<alt_bn128_pp> >(); test_output<G1<alt_bn128_pp> >();

View File

@ -5,9 +5,6 @@
* @copyright MIT license (see LICENSE file) * @copyright MIT license (see LICENSE file)
*****************************************************************************/ *****************************************************************************/
#include "common/profiling.hpp" #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 #ifdef CURVE_BN128
#include "algebra/curves/bn128/bn128_pp.hpp" #include "algebra/curves/bn128/bn128_pp.hpp"
#endif #endif
@ -97,45 +94,6 @@ void test_unitary_inverse()
EXPECT_EQ(aqcubed_minus1.inverse(), aqcubed_minus1.unitary_inverse()); EXPECT_EQ(aqcubed_minus1.inverse(), aqcubed_minus1.unitary_inverse());
} }
template<typename FieldT>
void test_cyclotomic_squaring();
template<>
void test_cyclotomic_squaring<Fqk<edwards_pp> >()
{
typedef Fqk<edwards_pp> 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<Fqk<mnt4_pp> >()
{
typedef Fqk<mnt4_pp> 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<Fqk<mnt6_pp> >()
{
typedef Fqk<mnt6_pp> 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<typename ppT> template<typename ppT>
void test_all_fields() void test_all_fields()
{ {
@ -220,20 +178,6 @@ void test_Fp4_tom_cook()
TEST(algebra, fields) TEST(algebra, fields)
{ {
edwards_pp::init_public_params();
test_all_fields<edwards_pp>();
test_cyclotomic_squaring<Fqk<edwards_pp> >();
mnt4_pp::init_public_params();
test_all_fields<mnt4_pp>();
test_Fp4_tom_cook<mnt4_Fq4>();
test_two_squarings<Fqe<mnt4_pp> >();
test_cyclotomic_squaring<Fqk<mnt4_pp> >();
mnt6_pp::init_public_params();
test_all_fields<mnt6_pp>();
test_cyclotomic_squaring<Fqk<mnt6_pp> >();
alt_bn128_pp::init_public_params(); alt_bn128_pp::init_public_params();
test_field<alt_bn128_Fq6>(); test_field<alt_bn128_Fq6>();
test_Frobenius<alt_bn128_Fq6>(); test_Frobenius<alt_bn128_Fq6>();

View File

@ -19,7 +19,6 @@
#include "common/data_structures/merkle_tree.hpp" #include "common/data_structures/merkle_tree.hpp"
#include "gadgetlib1/gadget.hpp" #include "gadgetlib1/gadget.hpp"
#include "gadgetlib1/gadgets/hashes/crh_gadget.hpp"
#include "gadgetlib1/gadgets/hashes/hash_io.hpp" #include "gadgetlib1/gadgets/hashes/hash_io.hpp"
#include "gadgetlib1/gadgets/hashes/digest_selector_gadget.hpp" #include "gadgetlib1/gadgets/hashes/digest_selector_gadget.hpp"
#include "gadgetlib1/gadgets/merkle_tree/merkle_authentication_path_variable.hpp" #include "gadgetlib1/gadgets/merkle_tree/merkle_authentication_path_variable.hpp"

View File

@ -8,9 +8,6 @@
#ifdef CURVE_BN128 #ifdef CURVE_BN128
#include "algebra/curves/bn128/bn128_pp.hpp" #include "algebra/curves/bn128/bn128_pp.hpp"
#endif #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_read_gadget.hpp"
#include "gadgetlib1/gadgets/merkle_tree/merkle_tree_check_update_gadget.hpp" #include "gadgetlib1/gadgets/merkle_tree/merkle_tree_check_update_gadget.hpp"
#include "gadgetlib1/gadgets/hashes/sha256/sha256_gadget.hpp" #include "gadgetlib1/gadgets/hashes/sha256/sha256_gadget.hpp"
@ -23,10 +20,8 @@ template<typename ppT>
void test_all_merkle_tree_gadgets() void test_all_merkle_tree_gadgets()
{ {
typedef Fr<ppT> FieldT; typedef Fr<ppT> FieldT;
test_merkle_tree_check_read_gadget<FieldT, CRH_with_bit_out_gadget<FieldT> >();
test_merkle_tree_check_read_gadget<FieldT, sha256_two_to_one_hash_gadget<FieldT> >(); test_merkle_tree_check_read_gadget<FieldT, sha256_two_to_one_hash_gadget<FieldT> >();
test_merkle_tree_check_update_gadget<FieldT, CRH_with_bit_out_gadget<FieldT> >();
test_merkle_tree_check_update_gadget<FieldT, sha256_two_to_one_hash_gadget<FieldT> >(); test_merkle_tree_check_update_gadget<FieldT, sha256_two_to_one_hash_gadget<FieldT> >();
} }
@ -38,13 +33,4 @@ TEST(gadgetlib1, merkle_tree)
bn128_pp::init_public_params(); bn128_pp::init_public_params();
test_all_merkle_tree_gadgets<bn128_pp>(); test_all_merkle_tree_gadgets<bn128_pp>();
#endif #endif
edwards_pp::init_public_params();
test_all_merkle_tree_gadgets<edwards_pp>();
mnt4_pp::init_public_params();
test_all_merkle_tree_gadgets<mnt4_pp>();
mnt6_pp::init_public_params();
test_all_merkle_tree_gadgets<mnt6_pp>();
} }

View File

@ -10,7 +10,6 @@
#include <cstring> #include <cstring>
#include <vector> #include <vector>
#include "algebra/curves/mnt/mnt6/mnt6_pp.hpp"
#include "algebra/fields/field_utils.hpp" #include "algebra/fields/field_utils.hpp"
#include "common/profiling.hpp" #include "common/profiling.hpp"
#include "common/utils.hpp" #include "common/utils.hpp"
@ -88,30 +87,13 @@ TEST(relations, qap)
{ {
start_profiling(); start_profiling();
mnt6_pp::init_public_params();
const size_t num_inputs = 10; const size_t num_inputs = 10;
const size_t basic_domain_size = 1ul<<mnt6_Fr::s;
const size_t step_domain_size = (1ul<<10) + (1ul<<8);
const size_t extended_domain_size = 1ul<<(mnt6_Fr::s+1);
const size_t extended_domain_size_special = extended_domain_size-1;
enter_block("Test QAP with binary input"); enter_block("Test QAP with binary input");
test_qap<Fr<mnt6_pp> >(basic_domain_size, num_inputs, true);
test_qap<Fr<mnt6_pp> >(step_domain_size, num_inputs, true);
test_qap<Fr<mnt6_pp> >(extended_domain_size, num_inputs, true);
test_qap<Fr<mnt6_pp> >(extended_domain_size_special, num_inputs, true);
leave_block("Test QAP with binary input"); leave_block("Test QAP with binary input");
enter_block("Test QAP with field input"); enter_block("Test QAP with field input");
test_qap<Fr<mnt6_pp> >(basic_domain_size, num_inputs, false);
test_qap<Fr<mnt6_pp> >(step_domain_size, num_inputs, false);
test_qap<Fr<mnt6_pp> >(extended_domain_size, num_inputs, false);
test_qap<Fr<mnt6_pp> >(extended_domain_size_special, num_inputs, false);
leave_block("Test QAP with field input"); leave_block("Test QAP with field input");
} }