Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Public Member Functions | Public Attributes | Protected Attributes | List of all members
libsnark::compliance_predicate_handler< FieldT, protoboardT > Class Template Referenceabstract

#include <cp_handler.hpp>

Public Member Functions

 compliance_predicate_handler (const protoboardT &pb, const size_t name, const size_t type, const size_t max_arity, const bool relies_on_same_type_inputs, const std::set< size_t > accepted_input_types=std::set< size_t >())
 
virtual void generate_r1cs_constraints ()=0
 
virtual void generate_r1cs_witness (const std::vector< std::shared_ptr< r1cs_pcd_message< FieldT >>> &incoming_message_values, const std::shared_ptr< r1cs_pcd_local_data< FieldT >> &local_data_value)
 
r1cs_pcd_compliance_predicate< FieldT > get_compliance_predicate () const
 
r1cs_variable_assignment< FieldT > get_full_variable_assignment () const
 
std::shared_ptr< r1cs_pcd_message< FieldT > > get_outgoing_message () const
 
size_t get_arity () const
 
std::shared_ptr< r1cs_pcd_message< FieldT > > get_incoming_message (const size_t message_idx) const
 
std::shared_ptr< r1cs_pcd_local_data< FieldT > > get_local_data () const
 
r1cs_variable_assignment< FieldT > get_witness () const
 

Public Attributes

const size_t name
 
const size_t type
 
const size_t max_arity
 
const bool relies_on_same_type_inputs
 
const std::set< size_t > accepted_input_types
 

Protected Attributes

protoboardT pb
 
std::shared_ptr< r1cs_pcd_message_variable< FieldT > > outgoing_message
 
pb_variable< FieldT > arity
 
std::vector< std::shared_ptr< r1cs_pcd_message_variable< FieldT > > > incoming_messages
 
std::shared_ptr< r1cs_pcd_local_data_variable< FieldT > > local_data
 

Detailed Description

template<typename FieldT, typename protoboardT>
class libsnark::compliance_predicate_handler< FieldT, protoboardT >

A base class for creating compliance predicates.

Definition at line 82 of file cp_handler.hpp.

Constructor & Destructor Documentation

◆ compliance_predicate_handler()

template<typename FieldT , typename protoboardT >
libsnark::compliance_predicate_handler< FieldT, protoboardT >::compliance_predicate_handler ( const protoboardT &  pb,
const size_t  name,
const size_t  type,
const size_t  max_arity,
const bool  relies_on_same_type_inputs,
const std::set< size_t >  accepted_input_types = std::set< size_t >() 
)

Member Function Documentation

◆ generate_r1cs_constraints()

template<typename FieldT , typename protoboardT >
virtual void libsnark::compliance_predicate_handler< FieldT, protoboardT >::generate_r1cs_constraints ( )
pure virtual

◆ generate_r1cs_witness()

template<typename FieldT , typename protoboardT >
virtual void libsnark::compliance_predicate_handler< FieldT, protoboardT >::generate_r1cs_witness ( const std::vector< std::shared_ptr< r1cs_pcd_message< FieldT >>> &  incoming_message_values,
const std::shared_ptr< r1cs_pcd_local_data< FieldT >> &  local_data_value 
)
virtual

◆ get_arity()

template<typename FieldT , typename protoboardT >
size_t libsnark::compliance_predicate_handler< FieldT, protoboardT >::get_arity ( ) const

◆ get_compliance_predicate()

template<typename FieldT , typename protoboardT >
r1cs_pcd_compliance_predicate<FieldT> libsnark::compliance_predicate_handler< FieldT, protoboardT >::get_compliance_predicate ( ) const

◆ get_full_variable_assignment()

template<typename FieldT , typename protoboardT >
r1cs_variable_assignment<FieldT> libsnark::compliance_predicate_handler< FieldT, protoboardT >::get_full_variable_assignment ( ) const

◆ get_incoming_message()

template<typename FieldT , typename protoboardT >
std::shared_ptr<r1cs_pcd_message<FieldT> > libsnark::compliance_predicate_handler< FieldT, protoboardT >::get_incoming_message ( const size_t  message_idx) const

◆ get_local_data()

template<typename FieldT , typename protoboardT >
std::shared_ptr<r1cs_pcd_local_data<FieldT> > libsnark::compliance_predicate_handler< FieldT, protoboardT >::get_local_data ( ) const

◆ get_outgoing_message()

template<typename FieldT , typename protoboardT >
std::shared_ptr<r1cs_pcd_message<FieldT> > libsnark::compliance_predicate_handler< FieldT, protoboardT >::get_outgoing_message ( ) const

◆ get_witness()

template<typename FieldT , typename protoboardT >
r1cs_variable_assignment<FieldT> libsnark::compliance_predicate_handler< FieldT, protoboardT >::get_witness ( ) const

Member Data Documentation

◆ accepted_input_types

template<typename FieldT , typename protoboardT >
const std::set<size_t> libsnark::compliance_predicate_handler< FieldT, protoboardT >::accepted_input_types

Definition at line 98 of file cp_handler.hpp.

◆ arity

template<typename FieldT , typename protoboardT >
pb_variable<FieldT> libsnark::compliance_predicate_handler< FieldT, protoboardT >::arity
protected

Definition at line 88 of file cp_handler.hpp.

◆ incoming_messages

template<typename FieldT , typename protoboardT >
std::vector<std::shared_ptr<r1cs_pcd_message_variable<FieldT> > > libsnark::compliance_predicate_handler< FieldT, protoboardT >::incoming_messages
protected

Definition at line 90 of file cp_handler.hpp.

◆ local_data

template<typename FieldT , typename protoboardT >
std::shared_ptr<r1cs_pcd_local_data_variable<FieldT> > libsnark::compliance_predicate_handler< FieldT, protoboardT >::local_data
protected

Definition at line 91 of file cp_handler.hpp.

◆ max_arity

template<typename FieldT , typename protoboardT >
const size_t libsnark::compliance_predicate_handler< FieldT, protoboardT >::max_arity

Definition at line 96 of file cp_handler.hpp.

◆ name

template<typename FieldT , typename protoboardT >
const size_t libsnark::compliance_predicate_handler< FieldT, protoboardT >::name

Definition at line 94 of file cp_handler.hpp.

◆ outgoing_message

template<typename FieldT , typename protoboardT >
std::shared_ptr<r1cs_pcd_message_variable<FieldT> > libsnark::compliance_predicate_handler< FieldT, protoboardT >::outgoing_message
protected

Definition at line 87 of file cp_handler.hpp.

◆ pb

template<typename FieldT , typename protoboardT >
protoboardT libsnark::compliance_predicate_handler< FieldT, protoboardT >::pb
protected

Definition at line 85 of file cp_handler.hpp.

◆ relies_on_same_type_inputs

template<typename FieldT , typename protoboardT >
const bool libsnark::compliance_predicate_handler< FieldT, protoboardT >::relies_on_same_type_inputs

Definition at line 97 of file cp_handler.hpp.

◆ type

template<typename FieldT , typename protoboardT >
const size_t libsnark::compliance_predicate_handler< FieldT, protoboardT >::type

Definition at line 95 of file cp_handler.hpp.


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