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::Fp2_variable< Fp2T > Class Template Reference

#include <fp2_gadgets.hpp>

Inheritance diagram for libsnark::Fp2_variable< Fp2T >:
Inheritance graph
[legend]
Collaboration diagram for libsnark::Fp2_variable< Fp2T >:
Collaboration graph
[legend]

Public Types

typedef Fp2T::my_Fp FieldT
 

Public Member Functions

 Fp2_variable (protoboard< FieldT > &pb, const std::string &annotation_prefix)
 
 Fp2_variable (protoboard< FieldT > &pb, const Fp2T &el, const std::string &annotation_prefix)
 
 Fp2_variable (protoboard< FieldT > &pb, const Fp2T &el, const pb_linear_combination< FieldT > &coeff, const std::string &annotation_prefix)
 
 Fp2_variable (protoboard< FieldT > &pb, const pb_linear_combination< FieldT > &c0, const pb_linear_combination< FieldT > &c1, const std::string &annotation_prefix)
 
void generate_r1cs_equals_const_constraints (const Fp2T &el)
 
void generate_r1cs_witness (const Fp2T &el)
 
Fp2T get_element () const
 
Fp2_variable< Fp2T > operator* (const FieldT &coeff) const
 
Fp2_variable< Fp2T > operator* (const Fp2T &fp2_const) const
 
Fp2_variable< Fp2T > operator+ (const Fp2_variable< Fp2T > &other) const
 
Fp2_variable< Fp2T > operator+ (const Fp2T &fp2_const) const
 
Fp2_variable< Fp2T > operator- (const Fp2_variable< Fp2T > &other) const
 
Fp2_variable< Fp2T > operator- () const
 
Fp2_variable< Fp2T > mul_by_X () const
 
Fp2_variable< Fp2T > frobenius_map (size_t power) const
 
void evaluate () const
 
bool is_constant () const
 
- Public Member Functions inherited from libsnark::gadget< Fp2T::my_Fp >
 gadget (protoboard< Fp2T::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_array< FieldTall_vars
 

Additional Inherited Members

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

Detailed Description

template<typename Fp2T>
class libsnark::Fp2_variable< Fp2T >

Gadget that represents an Fp2 variable.

Definition at line 27 of file fp2_gadgets.hpp.

Member Typedef Documentation

◆ FieldT

template<typename Fp2T >
typedef Fp2T::my_Fp libsnark::Fp2_variable< Fp2T >::FieldT

Definition at line 30 of file fp2_gadgets.hpp.

Constructor & Destructor Documentation

◆ Fp2_variable() [1/4]

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

◆ Fp2_variable() [2/4]

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

◆ Fp2_variable() [3/4]

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

◆ Fp2_variable() [4/4]

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

Member Function Documentation

◆ evaluate()

template<typename Fp2T >
void libsnark::Fp2_variable< Fp2T >::evaluate ( ) const

◆ frobenius_map()

template<typename Fp2T >
Fp2_variable<Fp2T> libsnark::Fp2_variable< Fp2T >::frobenius_map ( size_t  power) const

◆ generate_r1cs_equals_const_constraints()

template<typename Fp2T >
void libsnark::Fp2_variable< Fp2T >::generate_r1cs_equals_const_constraints ( const Fp2T &  el)

◆ generate_r1cs_witness()

template<typename Fp2T >
void libsnark::Fp2_variable< Fp2T >::generate_r1cs_witness ( const Fp2T &  el)

◆ get_element()

template<typename Fp2T >
Fp2T libsnark::Fp2_variable< Fp2T >::get_element ( ) const

◆ is_constant()

template<typename Fp2T >
bool libsnark::Fp2_variable< Fp2T >::is_constant ( ) const

◆ mul_by_X()

template<typename Fp2T >
Fp2_variable<Fp2T> libsnark::Fp2_variable< Fp2T >::mul_by_X ( ) const

◆ num_variables()

template<typename Fp2T >
static size_t libsnark::Fp2_variable< Fp2T >::num_variables ( )
static

◆ operator*() [1/2]

template<typename Fp2T >
Fp2_variable<Fp2T> libsnark::Fp2_variable< Fp2T >::operator* ( const FieldT coeff) const

◆ operator*() [2/2]

template<typename Fp2T >
Fp2_variable<Fp2T> libsnark::Fp2_variable< Fp2T >::operator* ( const Fp2T &  fp2_const) const

◆ operator+() [1/2]

template<typename Fp2T >
Fp2_variable<Fp2T> libsnark::Fp2_variable< Fp2T >::operator+ ( const Fp2_variable< Fp2T > &  other) const

◆ operator+() [2/2]

template<typename Fp2T >
Fp2_variable<Fp2T> libsnark::Fp2_variable< Fp2T >::operator+ ( const Fp2T &  fp2_const) const

◆ operator-() [1/2]

template<typename Fp2T >
Fp2_variable<Fp2T> libsnark::Fp2_variable< Fp2T >::operator- ( ) const

◆ operator-() [2/2]

template<typename Fp2T >
Fp2_variable<Fp2T> libsnark::Fp2_variable< Fp2T >::operator- ( const Fp2_variable< Fp2T > &  other) const

◆ size_in_bits()

template<typename Fp2T >
static size_t libsnark::Fp2_variable< Fp2T >::size_in_bits ( )
static

Member Data Documentation

◆ all_vars

template<typename Fp2T >
pb_linear_combination_array<FieldT> libsnark::Fp2_variable< Fp2T >::all_vars

Definition at line 35 of file fp2_gadgets.hpp.

◆ c0

template<typename Fp2T >
pb_linear_combination<FieldT> libsnark::Fp2_variable< Fp2T >::c0

Definition at line 32 of file fp2_gadgets.hpp.

◆ c1

template<typename Fp2T >
pb_linear_combination<FieldT> libsnark::Fp2_variable< Fp2T >::c1

Definition at line 33 of file fp2_gadgets.hpp.


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