Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
#include <tbcs.hpp>
Public Member Functions | |
bool | evaluate (const tbcs_variable_assignment &input) const |
void | print (const std::map< size_t, std::string > &variable_annotations=std::map< size_t, std::string >()) const |
bool | operator== (const tbcs_gate &other) const |
Public Attributes | |
tbcs_wire_t | left_wire |
tbcs_wire_t | right_wire |
tbcs_gate_type | type |
tbcs_wire_t | output |
bool | is_circuit_output |
Friends | |
std::ostream & | operator<< (std::ostream &out, const tbcs_gate &g) |
std::istream & | operator>> (std::istream &in, tbcs_gate &g) |
A TBCS gate is a formal expression of the form
g(left_wire,right_wire) = output ,
where 'left_wire' and 'right_wire' are the two input wires, and 'output' is the output wire. In other words, a TBCS gate is a 2-input boolean gate; there are 16 possible such gates (see tbcs_gate_type above).
A TBCS gate is used to construct a TBCS circuit (see below).
bool libsnark::tbcs_gate::evaluate | ( | const tbcs_variable_assignment & | input | ) | const |
bool libsnark::tbcs_gate::operator== | ( | const tbcs_gate & | other | ) | const |
void libsnark::tbcs_gate::print | ( | const std::map< size_t, std::string > & | variable_annotations = std::map<size_t, std::string>() | ) | const |
|
friend |
|
friend |
tbcs_wire_t libsnark::tbcs_gate::left_wire |
tbcs_wire_t libsnark::tbcs_gate::output |
tbcs_wire_t libsnark::tbcs_gate::right_wire |
tbcs_gate_type libsnark::tbcs_gate::type |