From 4699d0eb36e2049f692ead9f44c5886ba87a007c Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 11 Oct 2017 15:18:01 +0100 Subject: [PATCH] Add alt_bn128 to QAP and Merkle tree gadget tests --- .../gadgets/merkle_tree/tests/test_merkle_tree_gadgets.cpp | 4 ++++ .../src/relations/arithmetic_programs/qap/tests/test_qap.cpp | 5 +++++ 2 files changed, 9 insertions(+) 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 5f454687f..27b52f9ec 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 @@ -5,6 +5,7 @@ * @copyright MIT license (see LICENSE file) *****************************************************************************/ +#include "algebra/curves/alt_bn128/alt_bn128_pp.hpp" #ifdef CURVE_BN128 #include "algebra/curves/bn128/bn128_pp.hpp" #endif @@ -29,6 +30,9 @@ TEST(gadgetlib1, merkle_tree) { start_profiling(); + alt_bn128_pp::init_public_params(); + test_all_merkle_tree_gadgets(); + #ifdef CURVE_BN128 // BN128 has fancy dependencies so it may be disabled bn128_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 2cfa4fc92..e20f589c9 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,6 +10,7 @@ #include #include +#include "algebra/curves/alt_bn128/alt_bn128_pp.hpp" #include "algebra/fields/field_utils.hpp" #include "common/profiling.hpp" #include "common/utils.hpp" @@ -91,9 +92,13 @@ TEST(relations, qap) enter_block("Test QAP with binary input"); + test_qap >(1ul << 21, num_inputs, true); + leave_block("Test QAP with binary input"); enter_block("Test QAP with field input"); + test_qap >(1ul << 21, num_inputs, false); + leave_block("Test QAP with field input"); }