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

#include <variable.hpp>

Inheritance diagram for gadgetlib2::FElemInterface:
Inheritance graph
[legend]

Public Member Functions

virtual FElemInterfaceoperator= (const long n)=0
 
virtual FElemInterfaceoperator= (const FConst &src)=0
 
virtual ::std::string asString () const =0
 
virtual FieldType fieldType () const =0
 
virtual FElemInterfaceoperator+= (const FElemInterface &other)=0
 
virtual FElemInterfaceoperator-= (const FElemInterface &other)=0
 
virtual FElemInterfaceoperator*= (const FElemInterface &other)=0
 
virtual bool operator== (const FElemInterface &other) const =0
 
virtual bool operator== (const FConst &other) const =0
 
virtual bool operator== (const long n) const =0
 
virtual FElemInterfacePtr clone () const =0
 
virtual FElemInterfacePtr inverse () const =0
 
virtual long asLong () const =0
 
virtual int getBit (unsigned int i) const =0
 
virtual FElemInterfacepower (long exponent)=0
 
virtual ~FElemInterface ()
 

Detailed Description

An interface class for field elements. Currently 2 classes will derive from this interface: R1P_Elem - Elements of a field of prime characteristic FConst - Formally not a field, only placeholders for field agnostic constants, such as 0 and 1. Can be used for -1 or any other constant which makes semantic sense in all fields.

Definition at line 53 of file variable.hpp.

Constructor & Destructor Documentation

◆ ~FElemInterface()

virtual gadgetlib2::FElemInterface::~FElemInterface ( )
inlinevirtual

Definition at line 78 of file variable.hpp.

78 {};

Member Function Documentation

◆ asLong()

virtual long gadgetlib2::FElemInterface::asLong ( ) const
pure virtual

◆ asString()

virtual ::std::string gadgetlib2::FElemInterface::asString ( ) const
pure virtual

◆ clone()

virtual FElemInterfacePtr gadgetlib2::FElemInterface::clone ( ) const
pure virtual
Returns
a unique_ptr to a copy of the current element.

Implemented in gadgetlib2::R1P_Elem, and gadgetlib2::FConst.

◆ fieldType()

virtual FieldType gadgetlib2::FElemInterface::fieldType ( ) const
pure virtual

Implemented in gadgetlib2::R1P_Elem, and gadgetlib2::FConst.

Here is the caller graph for this function:

◆ getBit()

virtual int gadgetlib2::FElemInterface::getBit ( unsigned int  i) const
pure virtual

◆ inverse()

virtual FElemInterfacePtr gadgetlib2::FElemInterface::inverse ( ) const
pure virtual

◆ operator*=()

virtual FElemInterface& gadgetlib2::FElemInterface::operator*= ( const FElemInterface other)
pure virtual

◆ operator+=()

virtual FElemInterface& gadgetlib2::FElemInterface::operator+= ( const FElemInterface other)
pure virtual

◆ operator-=()

virtual FElemInterface& gadgetlib2::FElemInterface::operator-= ( const FElemInterface other)
pure virtual

◆ operator=() [1/2]

virtual FElemInterface& gadgetlib2::FElemInterface::operator= ( const FConst src)
pure virtual

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.

Implemented in gadgetlib2::R1P_Elem, and gadgetlib2::FConst.

◆ operator=() [2/2]

virtual FElemInterface& gadgetlib2::FElemInterface::operator= ( const long  n)
pure virtual

◆ operator==() [1/3]

virtual bool gadgetlib2::FElemInterface::operator== ( const FConst other) const
pure virtual

◆ operator==() [2/3]

virtual bool gadgetlib2::FElemInterface::operator== ( const FElemInterface other) const
pure virtual

◆ operator==() [3/3]

virtual bool gadgetlib2::FElemInterface::operator== ( const long  n) const
pure virtual

This operator is not always mathematically well defined. 'n' will be checked in runtime for fields in which integer values are not well defined.

Implemented in gadgetlib2::R1P_Elem, and gadgetlib2::FConst.

◆ power()

virtual FElemInterface& gadgetlib2::FElemInterface::power ( long  exponent)
pure virtual

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