Definition at line 113 of file tutorial.cpp.
◆ create()
◆ generateConstraints()
void gadgetExamples::NAND_Gadget::generateConstraints |
( |
| ) |
|
|
virtual |
Implements gadgetlib2::Gadget.
Definition at line 192 of file tutorial.cpp.
195 andGadget_->generateConstraints();
198 1, 1 - andResult_, output_,
"1 * (1 - andResult) = output");
210 for (
const auto &input : inputs_) {
◆ generateWitness()
void gadgetExamples::NAND_Gadget::generateWitness |
( |
| ) |
|
|
virtual |
Reimplemented from gadgetlib2::Gadget.
Definition at line 216 of file tutorial.cpp.
222 for (
const auto &input : inputs_) {
224 val(input) == 0 ||
val(input) == 1,
"NAND input is not boolean");
228 andGadget_->generateWitness();
230 val(output_) = 1 -
val(andResult_);
The documentation for this class was generated from the following file:
- /home/runner/work/libsnark/libsnark/libsnark/gadgetlib2/examples/tutorial.cpp