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

#include <qap.hpp>

Public Member Functions

 qap_instance (const std::shared_ptr< libfqfft::evaluation_domain< FieldT >> &domain, const size_t num_variables, const size_t degree, const size_t num_inputs, const std::vector< std::map< size_t, FieldT >> &A_in_Lagrange_basis, const std::vector< std::map< size_t, FieldT >> &B_in_Lagrange_basis, const std::vector< std::map< size_t, FieldT >> &C_in_Lagrange_basis)
 
 qap_instance (const std::shared_ptr< libfqfft::evaluation_domain< FieldT >> &domain, const size_t num_variables, const size_t degree, const size_t num_inputs, std::vector< std::map< size_t, FieldT >> &&A_in_Lagrange_basis, std::vector< std::map< size_t, FieldT >> &&B_in_Lagrange_basis, std::vector< std::map< size_t, FieldT >> &&C_in_Lagrange_basis)
 
 qap_instance (const qap_instance< FieldT > &other)=default
 
 qap_instance (qap_instance< FieldT > &&other)=default
 
qap_instanceoperator= (const qap_instance< FieldT > &other)=default
 
qap_instanceoperator= (qap_instance< FieldT > &&other)=default
 
size_t num_variables () const
 
size_t degree () const
 
size_t num_inputs () const
 
bool is_satisfied (const qap_witness< FieldT > &witness) const
 

Public Attributes

std::shared_ptr< libfqfft::evaluation_domain< FieldT > > domain
 
std::vector< std::map< size_t, FieldT > > A_in_Lagrange_basis
 
std::vector< std::map< size_t, FieldT > > B_in_Lagrange_basis
 
std::vector< std::map< size_t, FieldT > > C_in_Lagrange_basis
 

Detailed Description

template<typename FieldT>
class libsnark::qap_instance< FieldT >

A QAP instance.

Specifically, the datastructure stores:

(Each entry in the vector corresponds to a single input, representing a map of condition idx to the coefficients of that input in the linear combination A/B/C for that condition - namely the coefficients of the Lagrange polynomials forming u_i(\cdot), where A = \sum_i a_i * u_i(t)).

There is no need to store the Z polynomial because it is uniquely determined by the domain (as Z is its vanishing polynomial).

Definition at line 51 of file qap.hpp.

Constructor & Destructor Documentation

◆ qap_instance() [1/4]

template<typename FieldT >
libsnark::qap_instance< FieldT >::qap_instance ( const std::shared_ptr< libfqfft::evaluation_domain< FieldT >> &  domain,
const size_t  num_variables,
const size_t  degree,
const size_t  num_inputs,
const std::vector< std::map< size_t, FieldT >> &  A_in_Lagrange_basis,
const std::vector< std::map< size_t, FieldT >> &  B_in_Lagrange_basis,
const std::vector< std::map< size_t, FieldT >> &  C_in_Lagrange_basis 
)

◆ qap_instance() [2/4]

template<typename FieldT >
libsnark::qap_instance< FieldT >::qap_instance ( const std::shared_ptr< libfqfft::evaluation_domain< FieldT >> &  domain,
const size_t  num_variables,
const size_t  degree,
const size_t  num_inputs,
std::vector< std::map< size_t, FieldT >> &&  A_in_Lagrange_basis,
std::vector< std::map< size_t, FieldT >> &&  B_in_Lagrange_basis,
std::vector< std::map< size_t, FieldT >> &&  C_in_Lagrange_basis 
)

◆ qap_instance() [3/4]

template<typename FieldT >
libsnark::qap_instance< FieldT >::qap_instance ( const qap_instance< FieldT > &  other)
default

◆ qap_instance() [4/4]

template<typename FieldT >
libsnark::qap_instance< FieldT >::qap_instance ( qap_instance< FieldT > &&  other)
default

Member Function Documentation

◆ degree()

template<typename FieldT >
size_t libsnark::qap_instance< FieldT >::degree ( ) const

◆ is_satisfied()

template<typename FieldT >
bool libsnark::qap_instance< FieldT >::is_satisfied ( const qap_witness< FieldT > &  witness) const

◆ num_inputs()

template<typename FieldT >
size_t libsnark::qap_instance< FieldT >::num_inputs ( ) const

◆ num_variables()

template<typename FieldT >
size_t libsnark::qap_instance< FieldT >::num_variables ( ) const

◆ operator=() [1/2]

template<typename FieldT >
qap_instance& libsnark::qap_instance< FieldT >::operator= ( const qap_instance< FieldT > &  other)
default

◆ operator=() [2/2]

template<typename FieldT >
qap_instance& libsnark::qap_instance< FieldT >::operator= ( qap_instance< FieldT > &&  other)
default

Member Data Documentation

◆ A_in_Lagrange_basis

template<typename FieldT >
std::vector<std::map<size_t, FieldT> > libsnark::qap_instance< FieldT >::A_in_Lagrange_basis

Definition at line 61 of file qap.hpp.

◆ B_in_Lagrange_basis

template<typename FieldT >
std::vector<std::map<size_t, FieldT> > libsnark::qap_instance< FieldT >::B_in_Lagrange_basis

Definition at line 62 of file qap.hpp.

◆ C_in_Lagrange_basis

template<typename FieldT >
std::vector<std::map<size_t, FieldT> > libsnark::qap_instance< FieldT >::C_in_Lagrange_basis

Definition at line 63 of file qap.hpp.

◆ domain

template<typename FieldT >
std::shared_ptr<libfqfft::evaluation_domain<FieldT> > libsnark::qap_instance< FieldT >::domain

Definition at line 59 of file qap.hpp.


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