Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Public Types | Public Member Functions | List of all members
libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth > Class Template Reference

#include <circuit_wrapper.hpp>

Public Types

using Field = libff::Fr< ppT >
 
using joinsplit_type = joinsplit_gadget< Field, HashT, HashTreeT, NumInputs, NumOutputs, TreeDepth >
 
using input_hasher_type = mimc_input_hasher< Field, HashTreeT >
 

Public Member Functions

 circuit_wrapper ()
 
 circuit_wrapper (const circuit_wrapper &)=delete
 
circuit_wrapperoperator= (const circuit_wrapper &)=delete
 
snarkT::keypair generate_trusted_setup () const
 
const libsnark::r1cs_constraint_system< Field > & get_constraint_system () const
 
extended_proof< ppT, snarkT > prove (const Field &root, const std::array< joinsplit_input< Field, TreeDepth >, NumInputs > &inputs, const std::array< zeth_note, NumOutputs > &outputs, const bits64 &vpub_in, const bits64 &vpub_out, const bits256 &h_sig_in, const bits256 &phi_in, const typename snarkT::proving_key &proving_key, std::vector< Field > &out_public_data) const
 
const std::vector< Field > & get_last_assignment () const
 

Detailed Description

template<typename HashT, typename HashTreeT, typename ppT, typename snarkT, size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
class libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >

Wrapper around the joinsplit circuit, using parameterized schemes for hashing, and a snark scheme for generating keys and proofs.

Definition at line 27 of file circuit_wrapper.hpp.

Member Typedef Documentation

◆ Field

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
using libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::Field = libff::Fr<ppT>

Definition at line 30 of file circuit_wrapper.hpp.

◆ input_hasher_type

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
using libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::input_hasher_type = mimc_input_hasher<Field, HashTreeT>

Definition at line 40 of file circuit_wrapper.hpp.

◆ joinsplit_type

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
using libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::joinsplit_type = joinsplit_gadget< Field, HashT, HashTreeT, NumInputs, NumOutputs, TreeDepth>

Definition at line 39 of file circuit_wrapper.hpp.

Constructor & Destructor Documentation

◆ circuit_wrapper() [1/2]

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::circuit_wrapper ( )

◆ circuit_wrapper() [2/2]

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::circuit_wrapper ( const circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth > &  )
delete

Member Function Documentation

◆ generate_trusted_setup()

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
snarkT::keypair libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::generate_trusted_setup ( ) const
Here is the caller graph for this function:

◆ get_constraint_system()

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
const libsnark::r1cs_constraint_system<Field>& libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::get_constraint_system ( ) const
Here is the caller graph for this function:

◆ get_last_assignment()

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
const std::vector<Field>& libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::get_last_assignment ( ) const
Here is the caller graph for this function:

◆ operator=()

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
circuit_wrapper& libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::operator= ( const circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth > &  )
delete

◆ prove()

template<typename HashT , typename HashTreeT , typename ppT , typename snarkT , size_t NumInputs, size_t NumOutputs, size_t TreeDepth>
extended_proof<ppT, snarkT> libzeth::circuit_wrapper< HashT, HashTreeT, ppT, snarkT, NumInputs, NumOutputs, TreeDepth >::prove ( const Field root,
const std::array< joinsplit_input< Field, TreeDepth >, NumInputs > &  inputs,
const std::array< zeth_note, NumOutputs > &  outputs,
const bits64 vpub_in,
const bits64 vpub_out,
const bits256 h_sig_in,
const bits256 phi_in,
const typename snarkT::proving_key &  proving_key,
std::vector< Field > &  out_public_data 
) const
Here is the caller graph for this function:

The documentation for this class was generated from the following file: