Changes to get test_r1cs_ppzksnark passing
This commit is contained in:
@@ -83,7 +83,7 @@ bool run_r1cs_ppzksnark(const r1cs_example<Fr<ppT> > &example,
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_header("R1CS ppzkSNARK Prover");
|
print_header("R1CS ppzkSNARK Prover");
|
||||||
r1cs_ppzksnark_proof<ppT> proof = r1cs_ppzksnark_prover<ppT>(keypair.pk, example.primary_input, example.auxiliary_input);
|
r1cs_ppzksnark_proof<ppT> proof = r1cs_ppzksnark_prover<ppT>(keypair.pk, example.primary_input, example.auxiliary_input, example.constraint_system);
|
||||||
printf("\n"); print_indent(); print_mem("after prover");
|
printf("\n"); print_indent(); print_mem("after prover");
|
||||||
|
|
||||||
if (test_serialization)
|
if (test_serialization)
|
||||||
|
|||||||
@@ -394,7 +394,8 @@ r1cs_ppzksnark_keypair<ppT> r1cs_ppzksnark_generator(
|
|||||||
template<typename ppT>
|
template<typename ppT>
|
||||||
r1cs_ppzksnark_proof<ppT> r1cs_ppzksnark_prover(const r1cs_ppzksnark_proving_key<ppT> &pk,
|
r1cs_ppzksnark_proof<ppT> r1cs_ppzksnark_prover(const r1cs_ppzksnark_proving_key<ppT> &pk,
|
||||||
const r1cs_ppzksnark_primary_input<ppT> &primary_input,
|
const r1cs_ppzksnark_primary_input<ppT> &primary_input,
|
||||||
const r1cs_ppzksnark_auxiliary_input<ppT> &auxiliary_input);
|
const r1cs_ppzksnark_auxiliary_input<ppT> &auxiliary_input,
|
||||||
|
const r1cs_ppzksnark_constraint_system<ppT> &constraint_system);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Below are four variants of verifier algorithm for the R1CS ppzkSNARK.
|
Below are four variants of verifier algorithm for the R1CS ppzkSNARK.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#include "common/default_types/r1cs_ppzksnark_pp.hpp"
|
#include "algebra/curves/alt_bn128/alt_bn128_pp.hpp"
|
||||||
#include "common/profiling.hpp"
|
#include "common/profiling.hpp"
|
||||||
#include "common/utils.hpp"
|
#include "common/utils.hpp"
|
||||||
#include "relations/constraint_satisfaction_problems/r1cs/examples/r1cs_examples.hpp"
|
#include "relations/constraint_satisfaction_problems/r1cs/examples/r1cs_examples.hpp"
|
||||||
@@ -29,6 +29,7 @@ void test_r1cs_ppzksnark(size_t num_constraints,
|
|||||||
|
|
||||||
const bool test_serialization = true;
|
const bool test_serialization = true;
|
||||||
r1cs_example<Fr<ppT> > example = generate_r1cs_example_with_binary_input<Fr<ppT> >(num_constraints, input_size);
|
r1cs_example<Fr<ppT> > example = generate_r1cs_example_with_binary_input<Fr<ppT> >(num_constraints, input_size);
|
||||||
|
example.constraint_system.swap_AB_if_beneficial();
|
||||||
const bool bit = run_r1cs_ppzksnark<ppT>(example, test_serialization);
|
const bool bit = run_r1cs_ppzksnark<ppT>(example, test_serialization);
|
||||||
EXPECT_TRUE(bit);
|
EXPECT_TRUE(bit);
|
||||||
|
|
||||||
@@ -37,8 +38,7 @@ void test_r1cs_ppzksnark(size_t num_constraints,
|
|||||||
|
|
||||||
TEST(zk_proof_systems, r1cs_ppzksnark)
|
TEST(zk_proof_systems, r1cs_ppzksnark)
|
||||||
{
|
{
|
||||||
default_r1cs_ppzksnark_pp::init_public_params();
|
|
||||||
start_profiling();
|
start_profiling();
|
||||||
|
|
||||||
test_r1cs_ppzksnark<default_r1cs_ppzksnark_pp>(1000, 100);
|
test_r1cs_ppzksnark<alt_bn128_pp>(1000, 20);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user