nil::crypto3::zk::snark::bacs_circuit< FieldType > Struct Template Reference
#include <bacs.hpp>
Collaboration diagram for nil::crypto3::zk::snark::bacs_circuit< FieldType >:
Public Types | |
typedef FieldType | field_type |
Public Member Functions | |
void | add_gate (const bacs_gate< FieldType > &g) |
void | add_gate (const bacs_gate< FieldType > &g, const std::string &annotation) |
bacs_circuit () | |
std::size_t | depth () const |
bacs_variable_assignment< FieldType > | get_all_outputs (const bacs_primary_input< FieldType > &primary_input, const bacs_auxiliary_input< FieldType > &auxiliary_input) const |
bacs_variable_assignment< FieldType > | get_all_wires (const bacs_primary_input< FieldType > &primary_input, const bacs_auxiliary_input< FieldType > &auxiliary_input) const |
bool | is_satisfied (const bacs_primary_input< FieldType > &primary_input, const bacs_auxiliary_input< FieldType > &auxiliary_input) const |
bool | is_valid () const |
std::size_t | num_gates () const |
std::size_t | num_inputs () const |
std::size_t | num_wires () const |
bool | operator== (const bacs_circuit< FieldType > &other) const |
std::vector< std::size_t > | wire_depths () const |
Public Attributes | |
std::size_t | auxiliary_input_size |
std::vector< bacs_gate< FieldType > > | gates |
std::size_t | primary_input_size |
Detailed Description
template<typename FieldType>
struct nil::crypto3::zk::snark::bacs_circuit< FieldType >
A BACS circuit is an arithmetic circuit in which every gate is a BACS gate.
Given a BACS primary input and a BACS auxiliary input, the circuit can be evaluated. If every output evaluates to zero, then the circuit is satisfied.
NOTE: The 0-th variable (i.e., "x_{0}") always represents the constant 1. Thus, the 0-th variable is not included in num_variables.
Member Typedef Documentation
◆ field_type
template<typename FieldType >
typedef FieldType nil::crypto3::zk::snark::bacs_circuit< FieldType >::field_type |
Constructor & Destructor Documentation
◆ bacs_circuit()
template<typename FieldType >
|
inline |
Member Function Documentation
◆ add_gate() [1/2]
template<typename FieldType >
|
inline |
◆ add_gate() [2/2]
template<typename FieldType >
|
inline |
◆ depth()
template<typename FieldType >
|
inline |
◆ get_all_outputs()
template<typename FieldType >
|
inline |
◆ get_all_wires()
template<typename FieldType >
|
inline |
◆ is_satisfied()
template<typename FieldType >
|
inline |
◆ is_valid()
template<typename FieldType >
|
inline |
The output wire of gates[i] must have index 1+num_inputs+i. (The '1+' accounts for the the index of the constant wire.)
Gates must be topologically sorted.
◆ num_gates()
template<typename FieldType >
|
inline |
◆ num_inputs()
template<typename FieldType >
|
inline |
◆ num_wires()
template<typename FieldType >
|
inline |
◆ operator==()
template<typename FieldType >
|
inline |
◆ wire_depths()
template<typename FieldType >
|
inline |
Member Data Documentation
◆ auxiliary_input_size
template<typename FieldType >
std::size_t nil::crypto3::zk::snark::bacs_circuit< FieldType >::auxiliary_input_size |
◆ gates
template<typename FieldType >
std::vector<bacs_gate<FieldType> > nil::crypto3::zk::snark::bacs_circuit< FieldType >::gates |
◆ primary_input_size
template<typename FieldType >
std::size_t nil::crypto3::zk::snark::bacs_circuit< FieldType >::primary_input_size |
The documentation for this struct was generated from the following file: