|
void | initialize_suboptions (boost::program_options::options_description &options, boost::program_options::options_description &all_options, boost::program_options::positional_options_description &pos) override |
| Instantiation can now set up the boost program_options structures. More...
|
|
void | parse_suboptions (const boost::program_options::variables_map &vm) override |
|
void | subcommand_usage (const char *argv0) override |
| Any command-specific output for usage. More...
|
|
Protected Member Functions inherited from zethtool::generic_subcommand< prove_cmd > |
void | initialize_suboptions (boost::program_options::options_description &options, boost::program_options::options_description &, boost::program_options::positional_options_description &) override |
| Instantiation can now set up the boost program_options structures. More...
|
|
void | parse_suboptions (const boost::program_options::variables_map &vm) override |
|
int | execute_subcommand (const global_options &options) override |
|
Protected Member Functions inherited from libtool::subcommand< GlobalOptionsT > |
void | usage (const char *argv0, const boost::program_options::options_description &options) |
|
virtual int | execute_subcommand (const GlobalOptionsT &global)=0 |
| Execute the command using global options defined by the caller. More...
|
|
Definition at line 17 of file prove_cmd.cpp.
◆ base_class
◆ prove_cmd()
zethtool::commands::prove_cmd::prove_cmd |
( |
const std::string & |
subcommand_name, |
|
|
const std::string & |
description |
|
) |
| |
|
inline |
◆ execute_generic()
template<typename ppT , typename snarkT >
int zethtool::commands::prove_cmd::execute_generic |
( |
const global_options & |
| ) |
|
|
inline |
Definition at line 31 of file prove_cmd.cpp.
33 ppT::init_public_params();
35 libff::inhibit_profiling_info =
true;
36 libff::inhibit_profiling_counters =
true;
39 typename snarkT::proving_key proving_key;
42 snarkT::proving_key_read_bytes(proving_key, in_s);
45 libsnark::r1cs_primary_input<libff::Fr<ppT>> primary;
46 libsnark::r1cs_auxiliary_input<libff::Fr<ppT>> auxiliary;
54 typename snarkT::proof proof =
55 snarkT::generate_proof(proving_key, primary, auxiliary);
58 std::cout <<
"Writing proof to file: " <<
proof_file <<
"\n";
61 snarkT::proof_write_bytes(proof, out_s);
◆ initialize_suboptions()
void zethtool::commands::prove_cmd::initialize_suboptions |
( |
boost::program_options::options_description & |
options, |
|
|
boost::program_options::options_description & |
all_options, |
|
|
boost::program_options::positional_options_description & |
pos |
|
) |
| |
|
inlineoverrideprotectedvirtual |
Instantiation can now set up the boost program_options structures.
Implements libtool::subcommand< GlobalOptionsT >.
Definition at line 68 of file prove_cmd.cpp.
75 options.add_options()(
77 po::value<uint16_t>(),
78 "Number of primary inputs (default: 1)")(
79 "profile,r",
"Enable profiling output");
81 all_options.add(options).add_options()(
82 "pk_file", po::value<std::string>(),
"Proving key file");
83 all_options.add_options()(
84 "assignment_file", po::value<std::string>(),
"Assignment file");
85 all_options.add_options()(
86 "proof_file", po::value<std::string>(),
"(Output) Proof file");
88 pos.add(
"pk_file", 1);
89 pos.add(
"assignment_file", 1);
90 pos.add(
"proof_file", 1);
◆ parse_suboptions()
void zethtool::commands::prove_cmd::parse_suboptions |
( |
const boost::program_options::variables_map & |
vm | ) |
|
|
inlineoverrideprotectedvirtual |
Instantiation can record any command-specific information from the parsed variables_map.
Implements libtool::subcommand< GlobalOptionsT >.
Definition at line 93 of file prove_cmd.cpp.
98 if (vm.count(
"pk_file") == 0) {
99 throw po::error(
"pk_file not specified");
101 if (vm.count(
"assignment_file") == 0) {
102 throw po::error(
"assignment_file not specified");
104 if (vm.count(
"proof_file") == 0) {
105 throw po::error(
"proof_file not specified");
108 pk_file = vm[
"pk_file"].as<std::string>();
110 proof_file = vm[
"proof_file"].as<std::string>();
111 if (vm.count(
"primary_inputs")) {
114 profile = (bool)vm.count(
"profile");
◆ subcommand_usage()
void zethtool::commands::prove_cmd::subcommand_usage |
( |
const char * |
argv0 | ) |
|
|
inlineoverrideprotectedvirtual |
◆ assignment_file
std::string zethtool::commands::prove_cmd::assignment_file |
|
protected |
◆ num_primary_inputs
uint16_t zethtool::commands::prove_cmd::num_primary_inputs |
|
protected |
◆ pk_file
std::string zethtool::commands::prove_cmd::pk_file |
|
protected |
◆ profile
bool zethtool::commands::prove_cmd::profile |
|
protected |
◆ proof_file
std::string zethtool::commands::prove_cmd::proof_file |
|
protected |
The documentation for this class was generated from the following file: