Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
libsnark::Fp3_variable< Fp3T > Class Template Reference

#include <fp3_gadgets.hpp>

Inheritance diagram for libsnark::Fp3_variable< Fp3T >:
Inheritance graph
[legend]
Collaboration diagram for libsnark::Fp3_variable< Fp3T >:
Collaboration graph
[legend]

Public Types

typedef Fp3T::my_Fp FieldT
 

Public Member Functions

 Fp3_variable (protoboard< FieldT > &pb, const std::string &annotation_prefix)
 
 Fp3_variable (protoboard< FieldT > &pb, const Fp3T &el, const std::string &annotation_prefix)
 
 Fp3_variable (protoboard< FieldT > &pb, const Fp3T &el, const pb_linear_combination< FieldT > &coeff, const std::string &annotation_prefix)
 
 Fp3_variable (protoboard< FieldT > &pb, const pb_linear_combination< FieldT > &c0, const pb_linear_combination< FieldT > &c1, const pb_linear_combination< FieldT > &c2, const std::string &annotation_prefix)
 
void generate_r1cs_equals_const_constraints (const Fp3T &el)
 
void generate_r1cs_witness (const Fp3T &el)
 
Fp3T get_element ()
 
Fp3_variable< Fp3T > operator* (const FieldT &coeff) const
 
Fp3_variable< Fp3T > operator+ (const Fp3_variable< Fp3T > &other) const
 
Fp3_variable< Fp3T > operator+ (const Fp3T &other) const
 
Fp3_variable< Fp3T > mul_by_X () const
 
void evaluate () const
 
bool is_constant () const
 
- Public Member Functions inherited from libsnark::gadget< Fp3T::my_Fp >
 gadget (protoboard< Fp3T::my_Fp > &pb, const std::string &annotation_prefix)
 

Static Public Member Functions

static size_t size_in_bits ()
 
static size_t num_variables ()
 

Public Attributes

pb_linear_combination< FieldTc0
 
pb_linear_combination< FieldTc1
 
pb_linear_combination< FieldTc2
 
pb_linear_combination_array< FieldTall_vars
 

Additional Inherited Members

- Protected Attributes inherited from libsnark::gadget< Fp3T::my_Fp >
protoboard< Fp3T::my_Fp > & pb
 
const std::string annotation_prefix
 

Detailed Description

template<typename Fp3T>
class libsnark::Fp3_variable< Fp3T >

Gadget that represents an Fp3 variable.

Definition at line 27 of file fp3_gadgets.hpp.

Member Typedef Documentation

◆ FieldT

template<typename Fp3T >
typedef Fp3T::my_Fp libsnark::Fp3_variable< Fp3T >::FieldT

Definition at line 30 of file fp3_gadgets.hpp.

Constructor & Destructor Documentation

◆ Fp3_variable() [1/4]

template<typename Fp3T >
libsnark::Fp3_variable< Fp3T >::Fp3_variable ( protoboard< FieldT > &  pb,
const std::string &  annotation_prefix 
)

◆ Fp3_variable() [2/4]

template<typename Fp3T >
libsnark::Fp3_variable< Fp3T >::Fp3_variable ( protoboard< FieldT > &  pb,
const Fp3T &  el,
const std::string &  annotation_prefix 
)

◆ Fp3_variable() [3/4]

template<typename Fp3T >
libsnark::Fp3_variable< Fp3T >::Fp3_variable ( protoboard< FieldT > &  pb,
const Fp3T &  el,
const pb_linear_combination< FieldT > &  coeff,
const std::string &  annotation_prefix 
)

◆ Fp3_variable() [4/4]

template<typename Fp3T >
libsnark::Fp3_variable< Fp3T >::Fp3_variable ( protoboard< FieldT > &  pb,
const pb_linear_combination< FieldT > &  c0,
const pb_linear_combination< FieldT > &  c1,
const pb_linear_combination< FieldT > &  c2,
const std::string &  annotation_prefix 
)

Member Function Documentation

◆ evaluate()

template<typename Fp3T >
void libsnark::Fp3_variable< Fp3T >::evaluate ( ) const

◆ generate_r1cs_equals_const_constraints()

template<typename Fp3T >
void libsnark::Fp3_variable< Fp3T >::generate_r1cs_equals_const_constraints ( const Fp3T &  el)

◆ generate_r1cs_witness()

template<typename Fp3T >
void libsnark::Fp3_variable< Fp3T >::generate_r1cs_witness ( const Fp3T &  el)

◆ get_element()

template<typename Fp3T >
Fp3T libsnark::Fp3_variable< Fp3T >::get_element ( )

◆ is_constant()

template<typename Fp3T >
bool libsnark::Fp3_variable< Fp3T >::is_constant ( ) const

◆ mul_by_X()

template<typename Fp3T >
Fp3_variable<Fp3T> libsnark::Fp3_variable< Fp3T >::mul_by_X ( ) const

◆ num_variables()

template<typename Fp3T >
static size_t libsnark::Fp3_variable< Fp3T >::num_variables ( )
static

◆ operator*()

template<typename Fp3T >
Fp3_variable<Fp3T> libsnark::Fp3_variable< Fp3T >::operator* ( const FieldT coeff) const

◆ operator+() [1/2]

template<typename Fp3T >
Fp3_variable<Fp3T> libsnark::Fp3_variable< Fp3T >::operator+ ( const Fp3_variable< Fp3T > &  other) const

◆ operator+() [2/2]

template<typename Fp3T >
Fp3_variable<Fp3T> libsnark::Fp3_variable< Fp3T >::operator+ ( const Fp3T &  other) const

◆ size_in_bits()

template<typename Fp3T >
static size_t libsnark::Fp3_variable< Fp3T >::size_in_bits ( )
static

Member Data Documentation

◆ all_vars

template<typename Fp3T >
pb_linear_combination_array<FieldT> libsnark::Fp3_variable< Fp3T >::all_vars

Definition at line 36 of file fp3_gadgets.hpp.

◆ c0

template<typename Fp3T >
pb_linear_combination<FieldT> libsnark::Fp3_variable< Fp3T >::c0

Definition at line 32 of file fp3_gadgets.hpp.

◆ c1

template<typename Fp3T >
pb_linear_combination<FieldT> libsnark::Fp3_variable< Fp3T >::c1

Definition at line 33 of file fp3_gadgets.hpp.

◆ c2

template<typename Fp3T >
pb_linear_combination<FieldT> libsnark::Fp3_variable< Fp3T >::c2

Definition at line 34 of file fp3_gadgets.hpp.


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