Zeth - Zerocash on Ethereum
0.8
Reference implementation of the Zeth protocol by Clearmatics
|
Go to the documentation of this file.
5 #ifndef __ZETH_SNARKS_PGHR13_PGHR13_SNARK_HPP__
6 #define __ZETH_SNARKS_PGHR13_PGHR13_SNARK_HPP__
8 #include <boost/filesystem.hpp>
9 #include <libsnark/gadgetlib1/protoboard.hpp>
10 #include <libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp>
18 using proving_key = libsnark::r1cs_ppzksnark_proving_key<ppT>;
20 using keypair = libsnark::r1cs_ppzksnark_keypair<ppT>;
21 using proof = libsnark::r1cs_ppzksnark_proof<ppT>;
25 static const std::string
name;
29 const libsnark::protoboard<libff::Fr<ppT>> &pb);
34 const libsnark::protoboard<libff::Fr<ppT>> &pb);
39 const libsnark::r1cs_primary_input<libff::Fr<ppT>> &primary_input,
40 const libsnark::r1cs_auxiliary_input<libff::Fr<ppT>> auxiliary_input);
44 const libsnark::r1cs_primary_input<libff::Fr<ppT>> &primary_inputs,
85 #endif // __ZETH_SNARKS_PGHR13_PGHR13_SNARK_HPP__
static void verification_key_write_json(const verification_key &, std::ostream &)
Write verification as json.
libsnark::r1cs_ppzksnark_keypair< ppT > keypair
static void proof_read_bytes(proof &, std::istream &)
Read proof as bytes.
static void proving_key_read_bytes(proving_key &, std::istream &)
Read proving key as bytes.
static bool verify(const libsnark::r1cs_primary_input< libff::Fr< ppT >> &primary_inputs, const proof &proof, const verification_key &verification_key)
Verify proof.
static void verification_key_write_bytes(const verification_key &, std::ostream &)
Write verification key as bytes.
libsnark::r1cs_ppzksnark_proof< ppT > proof
static void verification_key_read_bytes(verification_key &, std::istream &)
Read a verification key as bytes.
static void keypair_write_bytes(const keypair &, std::ostream &)
Write a keypair as bytes.
static keypair generate_setup(const libsnark::protoboard< libff::Fr< ppT >> &pb)
Run the trusted setup and return the keypair for the circuit.
libsnark::r1cs_ppzksnark_proving_key< ppT > proving_key
static void proof_write_bytes(const proof &, std::ostream &)
Write proof as bytes.
static const std::string name
static proof generate_proof(const proving_key &proving_key, const libsnark::protoboard< libff::Fr< ppT >> &pb)
Generate the proof (from the values set to the protoboard)
static void proof_write_json(const proof &, std::ostream &)
Write proof as json.
static void keypair_read_bytes(keypair &, std::istream &)
Read a keypair from a stream.
static void proving_key_write_bytes(const proving_key &, std::ostream &)
Write proving key as bytes.
libsnark::r1cs_ppzksnark_verification_key< ppT > verification_key