-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest_r1cs_lattice_snark_p13_lpcp_tr.cpp
42 lines (32 loc) · 1.25 KB
/
test_r1cs_lattice_snark_p13_lpcp_tr.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "lwe/snark/r1cs_lattice_snark_lpcp_tr.hpp"
#include "lwe/tests/circ_lattice_params.hpp"
#include "lwe/tests/common.hpp"
using namespace libsnark;
using namespace LWE;
using Param = LWE::B13C15E;
int main(int argc, char *argv[]) {
if (argc < 3) {
std::cout << "usage: ./lwe/bin/r1cs_lattice_snark constraint_n input_n"
<< std::endl;
return -1;
}
using ring_pp = Ring_common_pp<Param::q_int>;
auto prg = new LWERandomness::PseudoRandomGenerator();
auto dg =
new LWERandomness::DiscreteGaussian(Param::width, LWE::expand, *prg);
public_params_init<Fp2_b13_pp, Fp_b13_pp, ring_pp>(prg, dg);
int num_constraints = std::stoi(std::string(argv[1])),
input_size = std::stoi(std::string(argv[2]));
std::cout << "q_log = " << Param::q_log << "\n"
<< "q_rescale = " << Param::rescale_q << "\n"
<< "b = " << Param::b_int << "\n"
<< "pt_dim = " << Param::pt_dim << "\n"
<< "n = " << Param::n << "\n"
<< "s = " << Param::width << std::endl;
libff::start_profiling();
test_r1cs_lattice_snark<Fp2_b13_pp, Fp_b13_pp, ring_pp, Param>(
num_constraints, input_size);
delete prg;
delete dg;
return 0;
}