33 #include <libff/common/profiling.hpp>
34 #include <libff/common/utils.hpp>
41 int main(
int argc,
const char *argv[])
43 default_r1cs_ppzksnark_pp::init_public_params();
44 libff::start_profiling();
46 if (argc == 2 && strcmp(argv[1],
"-v") == 0) {
47 libff::print_compilation_info();
51 if (argc != 3 && argc != 4) {
52 printf(
"usage: %s num_constraints input_size [Fr|bytes]\n", argv[0]);
55 const int num_constraints = atoi(argv[1]);
56 int input_size = atoi(argv[2]);
58 assert(strcmp(argv[3],
"Fr") == 0 || strcmp(argv[3],
"bytes") == 0);
59 if (strcmp(argv[3],
"bytes") == 0) {
60 input_size = libff::div_ceil(
61 8 * input_size, libff::Fr<libff::default_ec_pp>::capacity());
65 libff::enter_block(
"Generate R1CS example");
68 libff::Fr<default_r1cs_ppzksnark_pp>>(num_constraints, input_size);
69 libff::leave_block(
"Generate R1CS example");
71 libff::print_header(
"(enter) Profile R1CS ppzkSNARK");
72 const bool test_serialization =
true;
73 run_r1cs_ppzksnark<default_r1cs_ppzksnark_pp>(example, test_serialization);
74 libff::print_header(
"(leave) Profile R1CS ppzkSNARK");