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

#include <bacs.hpp>

Public Member Functions

FieldT evaluate (const bacs_variable_assignment< FieldT > &input) const
 
void print (const std::map< size_t, std::string > &variable_annotations=std::map< size_t, std::string >()) const
 
bool operator== (const bacs_gate< FieldT > &other) const
 

Public Attributes

linear_combination< FieldT > lhs
 
linear_combination< FieldT > rhs
 
variable< FieldT > output
 
bool is_circuit_output
 

Friends

std::ostream & operator (std::ostream &out, const bacs_gate< FieldT > &g)
 
std::istream & operator>> (std::istream &in, bacs_gate< FieldT > &g)
 

Detailed Description

template<typename FieldT>
struct libsnark::bacs_gate< FieldT >

A BACS gate is a formal expression of the form lhs * rhs = output , where lhs and rhs are linear combinations (of variables) and output is a variable.

In other words, a BACS gate is an arithmetic gate that is bilinear.

Definition at line 37 of file bacs.hpp.

Member Function Documentation

◆ evaluate()

template<typename FieldT >
FieldT libsnark::bacs_gate< FieldT >::evaluate ( const bacs_variable_assignment< FieldT > &  input) const

◆ operator==()

template<typename FieldT >
bool libsnark::bacs_gate< FieldT >::operator== ( const bacs_gate< FieldT > &  other) const

◆ print()

template<typename FieldT >
void libsnark::bacs_gate< FieldT >::print ( const std::map< size_t, std::string > &  variable_annotations = std::map< size_t, std::string >()) const

Friends And Related Function Documentation

◆ operator

template<typename FieldT >
std::ostream& operator ( std::ostream &  out,
const bacs_gate< FieldT > &  g 
)
friend

◆ operator>>

template<typename FieldT >
std::istream& operator>> ( std::istream &  in,
bacs_gate< FieldT > &  g 
)
friend

Member Data Documentation

◆ is_circuit_output

template<typename FieldT >
bool libsnark::bacs_gate< FieldT >::is_circuit_output

Definition at line 58 of file bacs.hpp.

◆ lhs

template<typename FieldT >
linear_combination<FieldT> libsnark::bacs_gate< FieldT >::lhs

Definition at line 54 of file bacs.hpp.

◆ output

template<typename FieldT >
variable<FieldT> libsnark::bacs_gate< FieldT >::output

Definition at line 57 of file bacs.hpp.

◆ rhs

template<typename FieldT >
linear_combination<FieldT> libsnark::bacs_gate< FieldT >::rhs

Definition at line 55 of file bacs.hpp.


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