#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <libff/common/profiling.hpp>
#include <libsnark/common/default_types/r1cs_ppzkadsnark_pp.hpp>
#include <libsnark/zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/examples/run_r1cs_ppzkadsnark.hpp>
#include <vector>
Go to the source code of this file.
|
int | main (int argc, const char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
const char * |
argv[] |
|
) |
| |
Definition at line 18 of file demo_r1cs_ppzkadsnark.cpp.
20 default_r1cs_ppzkadsnark_pp::init_public_params();
21 libff::start_profiling();
23 if (argc == 2 && strcmp(argv[1],
"-v") == 0) {
24 libff::print_compilation_info();
28 if (argc != 3 && argc != 4) {
29 printf(
"usage: %s num_constraints input_size [Fr|bytes]\n", argv[0]);
32 const int num_constraints = atoi(argv[1]);
33 int input_size = atoi(argv[2]);
35 assert(strcmp(argv[3],
"Fr") == 0 || strcmp(argv[3],
"bytes") == 0);
36 if (strcmp(argv[3],
"bytes") == 0) {
37 input_size = libff::div_ceil(
43 libff::enter_block(
"Generate R1CS example");
46 libff::Fr<snark_pp<default_r1cs_ppzkadsnark_pp>>>(
47 num_constraints, input_size);
48 libff::leave_block(
"Generate R1CS example");
50 libff::print_header(
"(enter) Profile R1CS ppzkADSNARK");
51 const bool test_serialization =
true;
52 run_r1cs_ppzkadsnark<default_r1cs_ppzkadsnark_pp>(
53 example, test_serialization);
54 libff::print_header(
"(leave) Profile R1CS ppzkADSNARK");