Perform curve parameter initialization at start of gtest suite.
This commit is contained in:
parent
ea92aba9fe
commit
ae6b333c75
|
@ -1,8 +1,15 @@
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "crypto/common.h"
|
#include "crypto/common.h"
|
||||||
|
|
||||||
|
#include "libsnark/common/default_types/r1cs_ppzksnark_pp.hpp"
|
||||||
|
#include "libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp"
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
assert(init_and_check_sodium() != -1);
|
assert(init_and_check_sodium() != -1);
|
||||||
|
libsnark::default_r1cs_ppzksnark_pp::init_public_params();
|
||||||
|
libsnark::inhibit_profiling_info = true;
|
||||||
|
libsnark::inhibit_profiling_counters = true;
|
||||||
|
|
||||||
testing::InitGoogleTest(&argc, argv);
|
testing::InitGoogleTest(&argc, argv);
|
||||||
return RUN_ALL_TESTS();
|
return RUN_ALL_TESTS();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ void test_value_equals(uint64_t i) {
|
||||||
|
|
||||||
TEST(circuit, values)
|
TEST(circuit, values)
|
||||||
{
|
{
|
||||||
default_r1cs_ppzksnark_pp::init_public_params();
|
|
||||||
typedef Fr<default_r1cs_ppzksnark_pp> FieldT;
|
typedef Fr<default_r1cs_ppzksnark_pp> FieldT;
|
||||||
test_value_equals<FieldT>(0);
|
test_value_equals<FieldT>(0);
|
||||||
test_value_equals<FieldT>(1);
|
test_value_equals<FieldT>(1);
|
||||||
|
@ -162,7 +161,6 @@ TEST(circuit, merkle_tree_gadget_weirdness)
|
||||||
behavior.
|
behavior.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
default_r1cs_ppzksnark_pp::init_public_params();
|
|
||||||
typedef Fr<default_r1cs_ppzksnark_pp> FieldT;
|
typedef Fr<default_r1cs_ppzksnark_pp> FieldT;
|
||||||
|
|
||||||
// Test the normal case
|
// Test the normal case
|
||||||
|
|
|
@ -170,8 +170,6 @@ void test_tree(Array root_tests, Array ser_tests, Array witness_ser_tests, Array
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(merkletree, vectors) {
|
TEST(merkletree, vectors) {
|
||||||
libsnark::default_r1cs_ppzksnark_pp::init_public_params();
|
|
||||||
|
|
||||||
Array root_tests = read_json(std::string(json_tests::merkle_roots, json_tests::merkle_roots + sizeof(json_tests::merkle_roots)));
|
Array root_tests = read_json(std::string(json_tests::merkle_roots, json_tests::merkle_roots + sizeof(json_tests::merkle_roots)));
|
||||||
Array ser_tests = read_json(std::string(json_tests::merkle_serialization, json_tests::merkle_serialization + sizeof(json_tests::merkle_serialization)));
|
Array ser_tests = read_json(std::string(json_tests::merkle_serialization, json_tests::merkle_serialization + sizeof(json_tests::merkle_serialization)));
|
||||||
Array witness_ser_tests = read_json(std::string(json_tests::merkle_witness_serialization, json_tests::merkle_witness_serialization + sizeof(json_tests::merkle_witness_serialization)));
|
Array witness_ser_tests = read_json(std::string(json_tests::merkle_witness_serialization, json_tests::merkle_witness_serialization + sizeof(json_tests::merkle_witness_serialization)));
|
||||||
|
|
Loading…
Reference in New Issue