Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
#include <variable.hpp>
Public Member Functions | |
FConst (const FConst &src) | |
virtual FConst & | operator= (const long n) |
virtual FConst & | operator= (const FConst &src) |
virtual ::std::string | asString () const |
virtual FieldType | fieldType () const |
virtual FConst & | operator+= (const FElemInterface &other) |
virtual FConst & | operator-= (const FElemInterface &other) |
virtual FConst & | operator*= (const FElemInterface &other) |
virtual bool | operator== (const FElemInterface &other) const |
virtual bool | operator== (const FConst &other) const |
virtual bool | operator== (const long n) const |
virtual FElemInterfacePtr | clone () const |
virtual FElemInterfacePtr | inverse () const |
long | asLong () const |
int | getBit (unsigned int i) const |
virtual FElemInterface & | power (long exponent) |
![]() | |
virtual | ~FElemInterface () |
Friends | |
class | FElem |
A field agnostic constant. All fields have constants 1 and 0 and this class allows us to hold an element agnostically while the context field is not known. For example, when given the very useful expression '1 - x' where x is a field agnostic formal variable, we must store the constant '1' without knowing over which field this expression will be evaluated. Constants can also hold integer values, which will be evaluated if possible, in runtime. For instance the expression '42 + x' will be evaluated in runtime in the trivial way when working over the prime characteristic Galois Field GF_43 but will cause a runtime error when evaluated over a GF2 extension field in which '42' has no obvious meaning, other than being the answer to life, the universe and everything.
Definition at line 189 of file variable.hpp.
|
inline |
Definition at line 196 of file variable.hpp.
|
inlinevirtual |
Implements gadgetlib2::FElemInterface.
Definition at line 232 of file variable.hpp.
|
inlinevirtual |
Implements gadgetlib2::FElemInterface.
Definition at line 207 of file variable.hpp.
|
inlinevirtual |
Implements gadgetlib2::FElemInterface.
Definition at line 225 of file variable.hpp.
|
inlinevirtual |
|
inlinevirtual |
Implements gadgetlib2::FElemInterface.
Definition at line 233 of file variable.hpp.
|
virtual |
Implements gadgetlib2::FElemInterface.
Definition at line 176 of file variable.cpp.
|
virtual |
Implements gadgetlib2::FElemInterface.
Definition at line 170 of file variable.cpp.
|
virtual |
Implements gadgetlib2::FElemInterface.
Definition at line 158 of file variable.cpp.
|
virtual |
Implements gadgetlib2::FElemInterface.
Definition at line 164 of file variable.cpp.
FConst will be field agnostic, allowing us to hold values such as 0 and 1 without knowing the underlying field. This assignment operator will convert to the correct field element.
Implements gadgetlib2::FElemInterface.
Definition at line 202 of file variable.hpp.
|
inlinevirtual |
Implements gadgetlib2::FElemInterface.
Definition at line 197 of file variable.hpp.
|
inlinevirtual |
Implements gadgetlib2::FElemInterface.
Definition at line 219 of file variable.hpp.
|
inlinevirtual |
Implements gadgetlib2::FElemInterface.
Definition at line 215 of file variable.hpp.
|
inlinevirtual |
This operator is not always mathematically well defined. 'n' will be checked in runtime for fields in which integer values are not well defined.
Implements gadgetlib2::FElemInterface.
Definition at line 223 of file variable.hpp.
|
virtual |
Implements gadgetlib2::FElemInterface.
Definition at line 181 of file variable.cpp.
|
friend |
Definition at line 240 of file variable.hpp.