Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Functions
profile_uscs_ppzksnark.cpp File Reference
#include <cassert>
#include <cstdio>
#include <libff/common/profiling.hpp>
#include <libff/common/utils.hpp>
#include <libsnark/common/default_types/uscs_ppzksnark_pp.hpp>
#include <libsnark/relations/constraint_satisfaction_problems/uscs/examples/uscs_examples.hpp>
#include <libsnark/zk_proof_systems/ppzksnark/uscs_ppzksnark/examples/run_uscs_ppzksnark.hpp>
Include dependency graph for profile_uscs_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 USCS instance.

The command

$

libsnark/zk_proof_systems/ppzksnark/uscs_ppzksnark/profiling/profile_uscs_ppzksnark 1000 10 Fr

exercises the ppzkSNARK (first generator, then prover, then verifier) on an USCS instance with 1000 equations and an input consisting of 10 field elements.

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

The command

$

libsnark/zk_proof_systems/ppzksnark/uscs_ppzksnark/profiling/profile_uscs_ppzksnark 1000 10 bytes

does the same but now the input consists of 10 bytes.

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

Definition in file profile_uscs_ppzksnark.cpp.

Function Documentation

◆ main()

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

Definition at line 42 of file profile_uscs_ppzksnark.cpp.

43 {
44  default_uscs_ppzksnark_pp::init_public_params();
45  libff::start_profiling();
46 
47  if (argc == 2 && strcmp(argv[1], "-v") == 0) {
48  libff::print_compilation_info();
49  return 0;
50  }
51 
52  if (argc != 3) {
53  printf("usage: %s num_constraints input_size\n", argv[0]);
54  return 1;
55  }
56 
57  const int num_constraints = atoi(argv[1]);
58  const int input_size = atoi(argv[2]);
59 
60  libff::enter_block("Generate USCS example");
63  libff::Fr<default_uscs_ppzksnark_pp>>(num_constraints, input_size);
64  libff::leave_block("Generate USCS example");
65 
66  libff::print_header("(enter) Profile USCS ppzkSNARK");
67  const bool test_serialization = true;
68  run_uscs_ppzksnark<default_uscs_ppzksnark_pp>(example, test_serialization);
69  libff::print_header("(leave) Profile USCS ppzkSNARK");
70 }
Here is the call graph for this function:
libsnark::uscs_example
Definition: uscs_examples.hpp:24
libsnark::generate_uscs_example_with_field_input
uscs_example< FieldT > generate_uscs_example_with_field_input(const size_t num_constraints, const size_t num_inputs)