Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
zethtool::commands::dump_proof_cmd Class Reference
Inheritance diagram for zethtool::commands::dump_proof_cmd:
Inheritance graph
[legend]
Collaboration diagram for zethtool::commands::dump_proof_cmd:
Collaboration graph
[legend]

Public Types

using base_class = generic_subcommand< dump_proof_cmd >
 

Public Member Functions

 dump_proof_cmd (const std::string &subcommand_name, const std::string &description)
 
template<typename ppT , typename snarkT >
int execute_generic (const global_options &)
 
- Public Member Functions inherited from zethtool::generic_subcommand< dump_proof_cmd >
 generic_subcommand (const std::string &subcommand_name, const std::string &description)
 
- Public Member Functions inherited from libtool::subcommand< GlobalOptionsT >
 subcommand (const std::string &subcommand_name, const std::string &description)
 
virtual ~subcommand ()
 
const std::string & description () const
 
int execute (const char *argv0, const std::vector< std::string > command_args, const GlobalOptionsT &global)
 Common code to parse options and invoke the virtual execute entrypoint. More...
 

Protected Member Functions

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< dump_proof_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...
 

Protected Attributes

std::string proof_file
 
- Protected Attributes inherited from zethtool::generic_subcommand< dump_proof_cmd >
std::string curve
 
std::string snark
 
- Protected Attributes inherited from libtool::subcommand< GlobalOptionsT >
std::string subcommand_name
 
std::string subcommand_description
 

Detailed Description

Definition at line 17 of file dump_proof_cmd.cpp.

Member Typedef Documentation

◆ base_class

Definition at line 20 of file dump_proof_cmd.cpp.

Constructor & Destructor Documentation

◆ dump_proof_cmd()

zethtool::commands::dump_proof_cmd::dump_proof_cmd ( const std::string &  subcommand_name,
const std::string &  description 
)
inline

Definition at line 22 of file dump_proof_cmd.cpp.

25  {
26  }

Member Function Documentation

◆ execute_generic()

template<typename ppT , typename snarkT >
int zethtool::commands::dump_proof_cmd::execute_generic ( const global_options )
inline

Definition at line 29 of file dump_proof_cmd.cpp.

30  {
31  ppT::init_public_params();
32  libff::inhibit_profiling_info = true;
33  libff::inhibit_profiling_counters = true;
34 
35  typename snarkT::proof proof;
36  {
37  std::ifstream in_s = libtool::open_binary_input_file(proof_file);
38  snarkT::proof_read_bytes(proof, in_s);
39  }
40 
41  snarkT::proof_write_json(proof, std::cout);
42  std::cout << "\n";
43  return 0;
44  };
Here is the call graph for this function:

◆ initialize_suboptions()

void zethtool::commands::dump_proof_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 47 of file dump_proof_cmd.cpp.

51  {
52  base_class::initialize_suboptions(options, all_options, pos);
53 
54  all_options.add(options).add_options()(
55  "proof_file", po::value<std::string>(), "(Output) Proof file");
56  pos.add("proof_file", 1);
57  }
Here is the call graph for this function:

◆ parse_suboptions()

void zethtool::commands::dump_proof_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 59 of file dump_proof_cmd.cpp.

61  {
63 
64  if (vm.count("proof_file") == 0) {
65  throw po::error("proof_file not specified");
66  }
67  proof_file = vm["proof_file"].as<std::string>();
68  }
Here is the call graph for this function:

◆ subcommand_usage()

void zethtool::commands::dump_proof_cmd::subcommand_usage ( const char *  argv0)
inlineoverrideprotectedvirtual

Any command-specific output for usage.

Implements libtool::subcommand< GlobalOptionsT >.

Definition at line 70 of file dump_proof_cmd.cpp.

71  {
72  std::cout << "Usage:\n " << argv0 << " dump-proof [proof_file]\n";
73  }

Member Data Documentation

◆ proof_file

std::string zethtool::commands::dump_proof_cmd::proof_file
protected

Definition at line 75 of file dump_proof_cmd.cpp.


The documentation for this class was generated from the following file:
zethtool::generic_subcommand< dump_proof_cmd >::parse_suboptions
void parse_suboptions(const boost::program_options::variables_map &vm) override
Definition: tool_common.hpp:111
libtool::subcommand::description
const std::string & description() const
zethtool::commands::dump_proof_cmd::proof_file
std::string proof_file
Definition: dump_proof_cmd.cpp:75
zethtool::generic_subcommand< dump_proof_cmd >::initialize_suboptions
void initialize_suboptions(boost::program_options::options_description &options, boost::program_options::options_description &, boost::program_options::positional_options_description &) override
Definition: tool_common.hpp:97
libtool::subcommand::subcommand_name
std::string subcommand_name
Definition: subcommand.hpp:54
libtool::open_binary_input_file
std::ifstream open_binary_input_file(const std::string &filename)
Definition: tool_util.cpp:10
zethtool::commands::dump_proof_cmd::base_class
generic_subcommand< dump_proof_cmd > base_class
Definition: dump_proof_cmd.cpp:20