Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Functions | Variables
mpc_common.hpp File Reference
#include "libzeth/core/include_libsnark.hpp"
#include "libzeth/mpc/groth16/mpc_hash.hpp"
#include "mpc_subcommand.hpp"
#include <boost/program_options.hpp>
#include <fstream>
#include <map>
#include <string>
#include <vector>
Include dependency graph for mpc_common.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename ReadableT >
ReadableT read_from_file (const std::string &file_name)
 
template<typename ReadableT >
ReadableT read_from_file_and_hash (const std::string &file_name, libzeth::mpc_hash_t out_hash)
 
int mpc_main (const std::map< std::string, mpc_subcommand * > &commands, const ProtoboardInitFn &pb_init, int argc, char **argv)
 Main entry point into the mpc command for a given circuit. More...
 

Variables

mpc_subcommandmpc_linear_combination_cmd
 
mpc_subcommandmpc_dummy_phase2_cmd
 
mpc_subcommandmpc_phase2_begin_cmd
 
mpc_subcommandmpc_phase2_contribute_cmd
 
mpc_subcommandmpc_phase2_verify_contribution_cmd
 
mpc_subcommandmpc_phase2_verify_transcript_cmd
 
mpc_subcommandmpc_create_keypair_cmd
 

Function Documentation

◆ mpc_main()

int mpc_main ( const std::map< std::string, mpc_subcommand * > &  commands,
const ProtoboardInitFn pb_init,
int  argc,
char **  argv 
)

Main entry point into the mpc command for a given circuit.

Definition at line 43 of file mpc_common.cpp.

48 {
49  libzeth::defaults::pp::init_public_params();
50 
51  global_options options{pb_init, false};
52  mpc_command cmd;
53  return libtool::run_command(cmd, options, subcommands, argc, argv);
54 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_from_file()

template<typename ReadableT >
ReadableT read_from_file ( const std::string &  file_name)
inline

Definition at line 26 of file mpc_common.hpp.

27 {
28  std::ifstream in(file_name, std::ios_base::binary | std::ios_base::in);
29  in.exceptions(
30  std::ios_base::eofbit | std::ios_base::badbit | std::ios_base::failbit);
31  return ReadableT::read(in);
32 }

◆ read_from_file_and_hash()

template<typename ReadableT >
ReadableT read_from_file_and_hash ( const std::string &  file_name,
libzeth::mpc_hash_t  out_hash 
)
inline

Definition at line 38 of file mpc_common.hpp.

40 {
41  std::ifstream inf(file_name, std::ios_base::binary | std::ios_base::in);
43  in.exceptions(
44  std::ios_base::eofbit | std::ios_base::badbit | std::ios_base::failbit);
45  ReadableT v = ReadableT::read(in);
46  in.get_hash(out_hash);
47  return v;
48 }
Here is the call graph for this function:

Variable Documentation

◆ mpc_create_keypair_cmd

mpc_subcommand* mpc_create_keypair_cmd

Definition at line 187 of file mpc_create_keypair.cpp.

◆ mpc_dummy_phase2_cmd

mpc_subcommand* mpc_dummy_phase2_cmd

Definition at line 116 of file mpc_dummy_phase2.cpp.

◆ mpc_linear_combination_cmd

mpc_subcommand* mpc_linear_combination_cmd

Definition at line 177 of file mpc_linear_combination.cpp.

◆ mpc_phase2_begin_cmd

mpc_subcommand* mpc_phase2_begin_cmd

Definition at line 119 of file mpc_phase2_begin.cpp.

◆ mpc_phase2_contribute_cmd

mpc_subcommand* mpc_phase2_contribute_cmd

Definition at line 167 of file mpc_phase2_contribute.cpp.

◆ mpc_phase2_verify_contribution_cmd

mpc_subcommand* mpc_phase2_verify_contribution_cmd

Definition at line 142 of file mpc_phase2_verify_contribution.cpp.

◆ mpc_phase2_verify_transcript_cmd

mpc_subcommand* mpc_phase2_verify_transcript_cmd

Definition at line 214 of file mpc_phase2_verify_transcript.cpp.

global_options
Definition: mpc_subcommand.hpp:15
libzeth::hash_istream_wrapper
Wrap some istream, hashing all data as it is read.
Definition: hash_stream.hpp:32
libtool::run_command
int run_command(command< GlobalOptionsT > &command, GlobalOptionsT &options, const std::map< std::string, subcommand< GlobalOptionsT > * > &subcommands, int argc, char **argv)