ComputeFHE 1.0
General-Purpose Privacy-Preserving Computation Library for TFHE
Loading...
Searching...
No Matches
Public Member Functions | List of all members
computefhe::EInt< T, BITS, SIGNED > Class Template Reference

Template class for fixed-size encrypted integers. More...

#include <Einteger.h>

Inheritance diagram for computefhe::EInt< T, BITS, SIGNED >:
Inheritance graph
[legend]
Collaboration diagram for computefhe::EInt< T, BITS, SIGNED >:
Collaboration graph
[legend]

Public Member Functions

 EInt (T d=0)
 
 EInt (const Einteger &other)
 
- Public Member Functions inherited from computefhe::Einteger
 Einteger ()
 Default constructor. Initializes an empty or zero-valued encrypted integer.
 
 Einteger (int64_t d)
 Constructs an Einteger from a plaintext int64_t.
 
 Einteger (size_t n_digits, bool is_signed)
 Constructs an Einteger with a specified number of bits and signedness.
 
 Einteger (int64_t d, size_t n_digits)
 Constructs an Einteger from a plaintext int64_t with a specified number of bits.
 
 Einteger (uint64_t d, size_t n_digits)
 Constructs an Einteger from a plaintext uint64_t with a specified number of bits.
 
 Einteger (const FixedPoint &fp, bool is_signed)
 Constructs an Einteger from an existing FixedPoint object.
 
 Einteger (const Einteger &other)
 Copy constructor.
 
virtual ~Einteger ()
 Destructor.
 
const FixedPointgetData () const
 Gets the underlying FixedPoint data.
 
size_t getSize () const
 Gets the number of bits used to represent the encrypted integer.
 
bool isSigned () const
 Checks if the encrypted integer is signed.
 
virtual const Einteger operator== (const Einteger &) const
 Encrypted equality comparison with another Einteger.
 
virtual const Einteger operator!= (const Einteger &) const
 Encrypted inequality comparison with another Einteger.
 
virtual const Einteger operator> (const Einteger &) const
 Encrypted greater-than comparison with another Einteger.
 
virtual const Einteger operator>= (const Einteger &) const
 Encrypted greater-than-or-equal comparison with another Einteger.
 
virtual const Einteger operator< (const Einteger &) const
 Encrypted less-than comparison with another Einteger.
 
virtual const Einteger operator<= (const Einteger &) const
 Encrypted less-than-or-equal comparison with another Einteger.
 
virtual const Einteger operator== (uint64_t) const
 Encrypted equality comparison with a plaintext uint64_t.
 
virtual const Einteger operator!= (uint64_t) const
 Encrypted inequality comparison with a plaintext uint64_t.
 
virtual const Einteger operator> (uint64_t) const
 Encrypted greater-than comparison with a plaintext uint64_t.
 
virtual const Einteger operator>= (uint64_t) const
 Encrypted greater-than-or-equal comparison with a plaintext uint64_t.
 
virtual const Einteger operator< (uint64_t) const
 Encrypted less-than comparison with a plaintext uint64_t.
 
virtual const Einteger operator<= (uint64_t) const
 Encrypted less-than-or-equal comparison with a plaintext uint64_t.
 
virtual const Einteger operator+ (const Einteger &) const
 Encrypted addition with another Einteger.
 
virtual const Einteger operator+= (const Einteger &)
 Encrypted addition assignment with another Einteger.
 
virtual const Einteger operator- (const Einteger &) const
 Encrypted subtraction with another Einteger.
 
virtual const Einteger operator-= (const Einteger &)
 Encrypted subtraction assignment with another Einteger.
 
virtual const Einteger operator* (const Einteger &) const
 Encrypted multiplication with another Einteger.
 
virtual const Einteger operator*= (const Einteger &)
 Encrypted multiplication assignment with another Einteger.
 
virtual const Einteger operator/ (const Einteger &) const
 Encrypted division with another Einteger.
 
virtual const Einteger operator/= (const Einteger &)
 Encrypted division assignment with another Einteger.
 
virtual const Einteger operator% (const Einteger &) const
 Encrypted modulo with another Einteger.
 
virtual const Einteger operator%= (const Einteger &)
 Encrypted modulo assignment with another Einteger.
 
virtual const Einteger operator+ (uint64_t) const
 Encrypted addition with a plaintext uint64_t.
 
virtual const Einteger operator+= (uint64_t)
 Encrypted addition assignment with a plaintext uint64_t.
 
virtual const Einteger operator- (uint64_t) const
 Encrypted subtraction with a plaintext uint64_t.
 
virtual const Einteger operator-= (uint64_t)
 Encrypted subtraction assignment with a plaintext uint64_t.
 
virtual const Einteger operator* (uint64_t) const
 Encrypted multiplication with a plaintext uint64_t.
 
virtual const Einteger operator*= (uint64_t)
 Encrypted multiplication assignment with a plaintext uint64_t.
 
virtual const Einteger operator/ (uint64_t) const
 Encrypted division with a plaintext uint64_t.
 
virtual const Einteger operator/= (uint64_t)
 Encrypted division assignment with a plaintext uint64_t.
 
virtual const Einteger operator% (uint64_t) const
 Encrypted modulo with a plaintext uint64_t.
 
virtual const Einteger operator%= (uint64_t)
 Encrypted modulo assignment with a plaintext uint64_t.
 
const Einteger operator- () const
 Encrypted unary negation (two's complement).
 
virtual const Einteger operator& (const Einteger &) const
 Encrypted bitwise AND with another Einteger.
 
virtual const Einteger operator&= (const Einteger &)
 Encrypted bitwise AND assignment with another Einteger.
 
virtual const Einteger operator| (const Einteger &) const
 Encrypted bitwise OR with another Einteger.
 
virtual const Einteger operator|= (const Einteger &)
 Encrypted bitwise OR assignment with another Einteger.
 
virtual const Einteger operator^ (const Einteger &) const
 Encrypted bitwise XOR with another Einteger.
 
virtual const Einteger operator^= (const Einteger &)
 Encrypted bitwise XOR assignment with another Einteger.
 
virtual const Einteger operator& (uint64_t) const
 Encrypted bitwise AND with a plaintext uint64_t.
 
virtual const Einteger operator&= (uint64_t)
 Encrypted bitwise AND assignment with a plaintext uint64_t.
 
virtual const Einteger operator| (uint64_t) const
 Encrypted bitwise OR with a plaintext uint64_t.
 
virtual const Einteger operator|= (uint64_t)
 Encrypted bitwise OR assignment with a plaintext uint64_t.
 
virtual const Einteger operator^ (uint64_t) const
 Encrypted bitwise XOR with a plaintext uint64_t.
 
virtual const Einteger operator^= (uint64_t)
 Encrypted bitwise XOR assignment with a plaintext uint64_t.
 
virtual const Einteger operator! () const
 Encrypted logical NOT.
 
virtual const Einteger operator~ () const
 Encrypted bitwise NOT (one's complement).
 
virtual const Einteger operator&& (const Einteger &) const
 Encrypted logical AND with another Einteger.
 
virtual const Einteger operator&& (uint64_t) const
 Encrypted logical AND with a plaintext uint64_t.
 
virtual const Einteger operator|| (const Einteger &) const
 Encrypted logical OR with another Einteger.
 
virtual const Einteger operator|| (uint64_t) const
 Encrypted logical OR with a plaintext uint64_t.
 
const Einteger operator++ ()
 Pre-increment operator. Increments the encrypted integer by one.
 
const Einteger operator++ (int)
 Post-increment operator. Increments the encrypted integer by one.
 
const Einteger operator-- ()
 Pre-decrement operator. Decrements the encrypted integer by one.
 
const Einteger operator-- (int)
 Post-decrement operator. Decrements the encrypted integer by one.
 
const Einteger operator<< (int) const
 Encrypted left shift.
 
const Einteger operator<<= (int)
 Encrypted left shift assignment.
 
const Einteger operator>> (int) const
 Encrypted right shift.
 
const Einteger operator>>= (int)
 Encrypted right shift assignment.
 
Eintegeroperator= (const Einteger &)
 Assignment operator from another Einteger.
 
Eintegeroperator= (uint64_t)
 Assignment operator from a plaintext uint64_t.
 
virtual operator bool () const
 Explicit conversion to decrypted boolean.
 
virtual operator int8_t () const
 Explicit conversion to decrypted int8_t.
 
virtual operator uint8_t () const
 Explicit conversion to decrypted uint8_t.
 
virtual operator int16_t () const
 Explicit conversion to decrypted int16_t.
 
virtual operator uint16_t () const
 Explicit conversion to decrypted uint16_t.
 
virtual operator int32_t () const
 Explicit conversion to decrypted int32_t.
 
virtual operator uint32_t () const
 Explicit conversion to decrypted uint32_t.
 
virtual operator int64_t () const
 Explicit conversion to decrypted int64_t.
 
virtual operator uint64_t () const
 Explicit conversion to decrypted uint64_t.
 
virtual operator double () const
 Explicit conversion to decrypted double.
 
template<class Archive >
void save (Archive &ar, std::uint32_t const version) const
 
template<class Archive >
void load (Archive &ar, std::uint32_t const version)
 
std::string SerializedObjectName () const override
 

Additional Inherited Members

- Static Public Member Functions inherited from computefhe::Einteger
static FixedPoint promote (const Einteger &a, size_t s)
 Promotes or truncates an Einteger to a specific bit size.
 
static uint32_t SerializedVersion ()
 
- Protected Member Functions inherited from computefhe::Einteger
void _sync_var ()
 
void _desync_var ()
 
- Static Protected Member Functions inherited from computefhe::Einteger
static int64_t sign_extend (uint64_t d, size_t n_digits)
 
static bool promote (const Einteger &a, const Einteger &b, FixedPoint &a_out, FixedPoint &b_out)
 
- Protected Attributes inherited from computefhe::Einteger
FixedPoint data
 
size_t size
 
bool sign
 
- Static Protected Attributes inherited from computefhe::Einteger
static FixedPoint cached_divident
 
static FixedPoint cached_divisor
 
static FixedPoint cached_quotient
 
static FixedPoint cached_remainder
 

Detailed Description

template<typename T, size_t BITS, bool SIGNED>
class computefhe::EInt< T, BITS, SIGNED >

Template class for fixed-size encrypted integers.

This template provides convenient type aliases for common integer sizes (e.g., Eint8, Euint32). It inherits from Einteger and sets the bit size and signedness during construction.

Template Parameters
TThe underlying plaintext type (e.g., int8_t, uint32_t).
BITSThe number of bits for the encrypted integer.
SIGNEDTrue if the integer is signed, false otherwise.

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