Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
#include <gadget.hpp>
Public Member Functions | |
void | generateConstraints () |
void | generateWitness () |
![]() | |
Gadget (ProtoboardPtr pb) | |
void | addUnaryConstraint (const LinearCombination &a, const ::std::string &name) |
void | addRank1Constraint (const LinearCombination &a, const LinearCombination &b, const LinearCombination &c, const ::std::string &name) |
void | enforceBooleanity (const Variable &var) |
FElem & | val (const Variable &var) |
FElem | val (const LinearCombination &lc) |
FieldType | fieldType () const |
bool | flagIsSet (const FlagVariable &flag) const |
Static Public Member Functions | |
static GadgetPtr | create (ProtoboardPtr pb, const FlagVariable &toggle, const LinearCombination &zeroValue, const LinearCombination &oneValue, const Variable &result) |
Additional Inherited Members | |
![]() | |
ProtoboardPtr | pb_ |
A gadget for the following semantics: If toggle is 0, zeroValue --> result If toggle is 1, oneValue --> result Uses 1 constraint
Definition at line 682 of file gadget.hpp.
|
static |
Definition at line 941 of file gadget.cpp.
|
virtual |
|
virtual |
Reimplemented from gadgetlib2::Gadget.
Definition at line 963 of file gadget.cpp.