Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Functions
profile_bacs_ppzksnark.cpp File Reference
#include <cstdio>
#include <libff/common/profiling.hpp>
#include <libsnark/common/default_types/bacs_ppzksnark_pp.hpp>
#include <libsnark/relations/circuit_satisfaction_problems/bacs/examples/bacs_examples.hpp>
#include <libsnark/zk_proof_systems/ppzksnark/bacs_ppzksnark/examples/run_bacs_ppzksnark.hpp>
Include dependency graph for profile_bacs_ppzksnark.cpp:

Go to the source code of this file.

Functions

int main (int argc, const char *argv[])
 

Detailed Description

Profiling program that exercises the ppzkSNARK (first generator, then prover, then verifier) on a synthetic BACS instance.

The command

$ libsnark/zk_proof_systems/bacs_ppzksnark/profiling/profile_bacs_ppzksnark

1000 10

exercises the ppzkSNARK (first generator, then prover, then verifier) on an BACS instance with 1000 gates and an input consisting of 10 Field elements

(If you get the error zmInit ERR:can't protect, see the discussion above.)

Author
This file is part of libsnark, developed by SCIPR Lab and contributors (see AUTHORS).

Definition in file profile_bacs_ppzksnark.cpp.

Function Documentation

◆ main()

int main ( int  argc,
const char *  argv[] 
)

Definition at line 31 of file profile_bacs_ppzksnark.cpp.

32 {
33  default_bacs_ppzksnark_pp::init_public_params();
34  libff::start_profiling();
35 
36  if (argc == 2 && strcmp(argv[1], "-v") == 0) {
37  libff::print_compilation_info();
38  return 0;
39  }
40 
41  if (argc != 3) {
42  printf("usage: %s num_gates primary_input_size\n", argv[0]);
43  return 1;
44  }
45  const int num_gates = atoi(argv[1]);
46  int primary_input_size = atoi(argv[2]);
47 
48  const size_t auxiliary_input_size = 0;
49  const size_t num_outputs = num_gates / 2;
50 
51  libff::enter_block("Generate BACS example");
53  generate_bacs_example<libff::Fr<default_bacs_ppzksnark_pp>>(
54  primary_input_size, auxiliary_input_size, num_gates, num_outputs);
55  libff::leave_block("Generate BACS example");
56 
57  libff::print_header("(enter) Profile BACS ppzkSNARK");
58  const bool test_serialization = true;
59  run_bacs_ppzksnark<default_bacs_ppzksnark_pp>(example, test_serialization);
60  libff::print_header("(leave) Profile BACS ppzkSNARK");
61 }
libsnark::bacs_example
Definition: bacs_examples.hpp:25