Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Public Member Functions | List of all members
libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds > Class Template Reference

#include <mimc_permutation.hpp>

Inheritance diagram for libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds >:
Inheritance graph
[legend]
Collaboration diagram for libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds >:
Collaboration graph
[legend]

Public Member Functions

 MiMC_permutation_gadget (libsnark::protoboard< FieldT > &pb, const libsnark::pb_linear_combination< FieldT > &msg, const libsnark::pb_linear_combination< FieldT > &key, const libsnark::pb_variable< FieldT > &result, const std::string &annotation_prefix="MiMC_permutation_gadget")
 
 MiMC_permutation_gadget (libsnark::protoboard< FieldT > &pb, const libsnark::pb_linear_combination< FieldT > &msg, const libsnark::pb_linear_combination< FieldT > &key, const libsnark::pb_variable< FieldT > &result, const libsnark::pb_linear_combination< FieldT > &add_to_result, const std::string &annotation_prefix="MiMC_permutation_gadget")
 
void generate_r1cs_constraints ()
 
void generate_r1cs_witness () const
 
void setup_sha3_constants ()
 

Detailed Description

template<typename FieldT, size_t Exponent, size_t NumRounds>
class libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds >

MiMC_permutation_gadget enforces correct computation of the MiMC permutation, denoted MiMC_r(k, m) in the Zeth specifications (https://github.com/clearmatics/zeth-specifications), by performing NumRounds MiMC rounds with the given Exponent. An optional add_to_result value can be passed in to be added to the result of the regular MiMC permutation (without requiring extra constraints).

Definition at line 20 of file mimc_permutation.hpp.

Constructor & Destructor Documentation

◆ MiMC_permutation_gadget() [1/2]

template<typename FieldT , size_t Exponent, size_t NumRounds>
libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds >::MiMC_permutation_gadget ( libsnark::protoboard< FieldT > &  pb,
const libsnark::pb_linear_combination< FieldT > &  msg,
const libsnark::pb_linear_combination< FieldT > &  key,
const libsnark::pb_variable< FieldT > &  result,
const std::string &  annotation_prefix = "MiMC_permutation_gadget< FieldT, Exponent, NumRounds >" 
)

◆ MiMC_permutation_gadget() [2/2]

template<typename FieldT , size_t Exponent, size_t NumRounds>
libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds >::MiMC_permutation_gadget ( libsnark::protoboard< FieldT > &  pb,
const libsnark::pb_linear_combination< FieldT > &  msg,
const libsnark::pb_linear_combination< FieldT > &  key,
const libsnark::pb_variable< FieldT > &  result,
const libsnark::pb_linear_combination< FieldT > &  add_to_result,
const std::string &  annotation_prefix = "MiMC_permutation_gadget< FieldT, Exponent, NumRounds >" 
)

Member Function Documentation

◆ generate_r1cs_constraints()

template<typename FieldT , size_t Exponent, size_t NumRounds>
void libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds >::generate_r1cs_constraints ( )

◆ generate_r1cs_witness()

template<typename FieldT , size_t Exponent, size_t NumRounds>
void libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds >::generate_r1cs_witness ( ) const

◆ setup_sha3_constants()

template<typename FieldT , size_t Exponent, size_t NumRounds>
void libzeth::MiMC_permutation_gadget< FieldT, Exponent, NumRounds >::setup_sha3_constants ( )

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