]> Git Repo - VerusCoin.git/commitdiff
Changes to get test_r1cs_ppzksnark passing
authorJack Grigg <[email protected]>
Wed, 11 Oct 2017 14:31:42 +0000 (15:31 +0100)
committerJack Grigg <[email protected]>
Wed, 11 Oct 2017 20:15:49 +0000 (21:15 +0100)
src/snark/src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/examples/run_r1cs_ppzksnark.tcc
src/snark/src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp
src/snark/src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/tests/test_r1cs_ppzksnark.cpp

index 9bc875869101debeb2a04ece47b0f1a636f0add4..00af6fe25e3fbc76c97d22e8c4a951ed840ce279 100644 (file)
@@ -83,7 +83,7 @@ bool run_r1cs_ppzksnark(const r1cs_example<Fr<ppT> > &example,
     }
 
     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");
 
     if (test_serialization)
index a068b09fde1b7502711ee89cbd6da3f936d8548f..36f6c14999636aa4cfaeda7e6a5fd09dd691a48e 100644 (file)
@@ -394,7 +394,8 @@ r1cs_ppzksnark_keypair<ppT> r1cs_ppzksnark_generator(
 template<typename ppT>
 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_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.
index 36b5735490a07cd7ec9e2d03391aa7439514b221..6c6e51857f5309ed7f605a581fb92bfa9c69ceaa 100644 (file)
@@ -11,7 +11,7 @@
 #include <cassert>
 #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/utils.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;
     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);
     EXPECT_TRUE(bit);
 
@@ -37,8 +38,7 @@ void test_r1cs_ppzksnark(size_t num_constraints,
 
 TEST(zk_proof_systems, r1cs_ppzksnark)
 {
-    default_r1cs_ppzksnark_pp::init_public_params();
     start_profiling();
 
-    test_r1cs_ppzksnark<default_r1cs_ppzksnark_pp>(1000, 100);
+    test_r1cs_ppzksnark<alt_bn128_pp>(1000, 20);
 }
This page took 0.030258 seconds and 4 git commands to generate.