emp-toolkit
Integer Class Reference

#include <integer.h>

Inheritance diagram for Integer:
Swappable< Integer > Comparable< Integer >

Public Member Functions

 Integer (Integer &&in)
 
 Integer (const Integer &in)
 
Integeroperator= (Integer rhs)
 
 Integer (int len, const void *b)
 
 ~Integer ()
 
 Integer (int length, const string &str, int party=PUBLIC)
 
 Integer (int length, long long input, int party=PUBLIC)
 
 Integer ()
 
Bit geq (const Integer &rhs) const
 
Bit equal (const Integer &rhs) const
 
Integer select (const Bit &sel, const Integer &rhs) const
 
Integer operator^ (const Integer &rhs) const
 
int size () const
 
template<typename O >
reveal (int party=PUBLIC) const
 
Integer abs () const
 
Integerresize (int length, bool signed_extend=true)
 
Integer modExp (Integer p, Integer q)
 
Integer leading_zeros () const
 
Integer hamming_weight () const
 
Integer operator<< (int shamt) const
 
Integer operator>> (int shamt) const
 
Integer operator<< (const Integer &shamt) const
 
Integer operator>> (const Integer &shamt) const
 
Integer operator+ (const Integer &rhs) const
 
Integer operator- (const Integer &rhs) const
 
Integer operator- () const
 
Integer operator* (const Integer &rhs) const
 
Integer operator/ (const Integer &rhs) const
 
Integer operator% (const Integer &rhs) const
 
Integer operator & (const Integer &rhs) const
 
Integer operator| (const Integer &rhs) const
 
Bitoperator[] (int index)
 
const Bitoperator[] (int index) const
 
template<>
string reveal (int party) const
 
template<>
int reveal (int party) const
 
template<>
uint32_t reveal (int party) const
 
template<>
long long reveal (int party) const
 
- Public Member Functions inherited from Swappable< Integer >
Integer If (const Bit &sel, const Integer &rhs) const
 
- Public Member Functions inherited from Comparable< Integer >
Bit operator>= (const Integer &rhs) const
 
Bit operator< (const Integer &rhs) const
 
Bit operator<= (const Integer &rhs) const
 
Bit operator> (const Integer &rhs) const
 
Bit operator== (const Integer &rhs) const
 
Bit operator!= (const Integer &rhs) const
 

Static Public Member Functions

template<typename... Args>
static size_t bool_size (size_t size, Args... args)
 
static void bool_data (bool *data, size_t len, long long num)
 
static void bool_data (bool *data, size_t len, string str)
 

Public Attributes

int length = 0
 
Bitbits = nullptr
 

Constructor & Destructor Documentation

§ Integer() [1/6]

Integer::Integer ( Integer &&  in)
inline

§ Integer() [2/6]

Integer::Integer ( const Integer in)
inline

§ Integer() [3/6]

Integer::Integer ( int  len,
const void *  b 
)
inline

§ ~Integer()

Integer::~Integer ( )
inline

§ Integer() [4/6]

Integer::Integer ( int  length,
const string &  str,
int  party = PUBLIC 
)
inline

§ Integer() [5/6]

Integer::Integer ( int  length,
long long  input,
int  party = PUBLIC 
)
inline

§ Integer() [6/6]

Integer::Integer ( )
inline

Member Function Documentation

§ abs()

Integer Integer::abs ( ) const
inline

§ bool_data() [1/2]

static void Integer::bool_data ( bool *  data,
size_t  len,
long long  num 
)
inlinestatic

§ bool_data() [2/2]

static void Integer::bool_data ( bool *  data,
size_t  len,
string  str 
)
inlinestatic

§ bool_size()

template<typename... Args>
static size_t Integer::bool_size ( size_t  size,
Args...  args 
)
inlinestatic

§ equal()

Bit Integer::equal ( const Integer rhs) const
inline

§ geq()

Bit Integer::geq ( const Integer rhs) const
inline

§ hamming_weight()

Integer Integer::hamming_weight ( ) const
inline

§ leading_zeros()

Integer Integer::leading_zeros ( ) const
inline

§ modExp()

Integer Integer::modExp ( Integer  p,
Integer  q 
)
inline

§ operator &()

Integer Integer::operator& ( const Integer rhs) const

§ operator%()

Integer Integer::operator% ( const Integer rhs) const
inline

§ operator*()

Integer Integer::operator* ( const Integer rhs) const
inline

§ operator+()

Integer Integer::operator+ ( const Integer rhs) const
inline

§ operator-() [1/2]

Integer Integer::operator- ( const Integer rhs) const
inline

§ operator-() [2/2]

Integer Integer::operator- ( ) const
inline

§ operator/()

Integer Integer::operator/ ( const Integer rhs) const
inline

§ operator<<() [1/2]

Integer Integer::operator<< ( int  shamt) const
inline

§ operator<<() [2/2]

Integer Integer::operator<< ( const Integer shamt) const
inline

§ operator=()

Integer& Integer::operator= ( Integer  rhs)
inline

§ operator>>() [1/2]

Integer Integer::operator>> ( int  shamt) const
inline

§ operator>>() [2/2]

Integer Integer::operator>> ( const Integer shamt) const
inline

§ operator[]() [1/2]

Bit & Integer::operator[] ( int  index)
inline

§ operator[]() [2/2]

const Bit & Integer::operator[] ( int  index) const
inline

§ operator^()

Integer Integer::operator^ ( const Integer rhs) const
inline

§ operator|()

Integer Integer::operator| ( const Integer rhs) const
inline

§ resize()

Integer & Integer::resize ( int  length,
bool  signed_extend = true 
)
inline

§ reveal() [1/5]

template<typename O >
O Integer::reveal ( int  party = PUBLIC) const

§ reveal() [2/5]

template<>
string Integer::reveal ( int  party) const
inline

§ reveal() [3/5]

template<>
int Integer::reveal ( int  party) const
inline

§ reveal() [4/5]

template<>
uint32_t Integer::reveal ( int  party) const
inline

§ reveal() [5/5]

template<>
long long Integer::reveal ( int  party) const
inline

§ select()

Integer Integer::select ( const Bit sel,
const Integer rhs 
) const
inline

§ size()

int Integer::size ( ) const
inline

Member Data Documentation

§ bits

Bit* Integer::bits = nullptr

§ length

int Integer::length = 0

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