Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Static Public Member Functions | List of all members
gadgetlib2::OR_Gadget Class Reference

#include <gadget.hpp>

Static Public Member Functions

static GadgetPtr create (ProtoboardPtr pb, const VariableArray &input, const Variable &result)
 
static GadgetPtr create (ProtoboardPtr pb, const LinearCombination &input1, const LinearCombination &input2, const Variable &result)
 

Detailed Description

Definition at line 301 of file gadget.hpp.

Member Function Documentation

◆ create() [1/2]

GadgetPtr gadgetlib2::OR_Gadget::create ( ProtoboardPtr  pb,
const LinearCombination input1,
const LinearCombination input2,
const Variable result 
)
static

Definition at line 337 of file gadget.cpp.

342 {
343  GadgetPtr pGadget(new BinaryOR_Gadget(pb, input1, input2, result));
344  pGadget->init();
345  return pGadget;
346 }

◆ create() [2/2]

GadgetPtr gadgetlib2::OR_Gadget::create ( ProtoboardPtr  pb,
const VariableArray input,
const Variable result 
)
static

Definition at line 323 of file gadget.cpp.

325 {
326  GadgetPtr pGadget;
327  if (pb->fieldType_ == R1P) {
328  pGadget.reset(new R1P_OR_Gadget(pb, input, result));
329  } else {
331  "Attempted to create gadget of undefined Protoboard type.");
332  }
333  pGadget->init();
334  return pGadget;
335 }

The documentation for this class was generated from the following files:
GADGETLIB_FATAL
#define GADGETLIB_FATAL(msg)
Definition: infrastructure.hpp:85
gadgetlib2::GadgetPtr
::std::shared_ptr< Gadget > GadgetPtr
Definition: gadget.hpp:119
gadgetlib2::R1P
@ R1P
Definition: variable.hpp:37