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

Proxy object for accessing and modifying elements in an Evector using encrypted indices. More...

#include <Evector.h>

Collaboration diagram for computefhe::Eitem< T, U >:
Collaboration graph
[legend]

Public Member Functions

 Eitem (Evector< T > &vec, const Einteger &idx)
 Constructs a proxy item using an encrypted index.
 
 Eitem (Evector< T > &vec, const size_t idx)
 Constructs a proxy item using a plaintext index.
 
 operator T () const
 Implicit conversion to the underlying encrypted type T.
 
template<typename V , typename = std::enable_if_t<std::is_constructible_v<V, T> && !std::is_same_v<V, T>>>
 operator V () const
 Implicit conversion to any type constructible from T (e.g., derived types like Euint64).
 
const Toperator= (const T &value)
 Assignment operator: conditionally updates vector elements based on the index.
 
const Toperator= (U value)
 Assignment operator from a plaintext value: converts to T using vector element metadata and then updates elements.
 
Arithmetic Operators
T operator+ (const T &b) const
 
T operator+ (U b) const
 
T operator- (const T &b) const
 
T operator- (U b) const
 
T operator* (const T &b) const
 
T operator* (U b) const
 
T operator/ (const T &b) const
 
T operator/ (U b) const
 
T operator% (const T &b) const
 
T operator% (U b) const
 
Bitwise Logic Operators
T operator& (const T &b) const
 
T operator& (U b) const
 
T operator| (const T &b) const
 
T operator| (U b) const
 
T operator^ (const T &b) const
 
T operator^ (U b) const
 
Comparison Operators
Einteger operator== (const T &b) const
 
Einteger operator== (U b) const
 
Einteger operator!= (const T &b) const
 
Einteger operator!= (U b) const
 
Einteger operator> (const T &b) const
 
Einteger operator> (U b) const
 
Einteger operator>= (const T &b) const
 
Einteger operator>= (U b) const
 
Einteger operator< (const T &b) const
 
Einteger operator< (U b) const
 
Einteger operator<= (const T &b) const
 
Einteger operator<= (U b) const
 
Logical Operators
T operator&& (const T &b) const
 
T operator&& (U b) const
 
T operator|| (const T &b) const
 
T operator|| (U b) const
 
Shift Operators
T operator<< (int b) const
 
T operator>> (int b) const
 
Compound Assignment Operators
Eitem< T, U > & operator+= (const T &b)
 
Eitem< T, U > & operator+= (U b)
 
Eitem< T, U > & operator-= (const T &b)
 
Eitem< T, U > & operator-= (U b)
 
Eitem< T, U > & operator*= (const T &b)
 
Eitem< T, U > & operator*= (U b)
 
Eitem< T, U > & operator/= (const T &b)
 
Eitem< T, U > & operator/= (U b)
 
Eitem< T, U > & operator%= (const T &b)
 
Eitem< T, U > & operator%= (U b)
 
Eitem< T, U > & operator&= (const T &b)
 
Eitem< T, U > & operator&= (U b)
 
Eitem< T, U > & operator|= (const T &b)
 
Eitem< T, U > & operator|= (U b)
 
Eitem< T, U > & operator^= (const T &b)
 
Eitem< T, U > & operator^= (U b)
 
Eitem< T, U > & operator<<= (int b)
 
Eitem< T, U > & operator>>= (int b)
 
Unary and Inc/Dec Operators
T operator! () const
 
T operator~ () const
 
T operator- () const
 
T operator++ ()
 
T operator++ (int)
 
T operator-- ()
 
T operator-- (int)
 

Protected Attributes

Evector< T > & data
 Reference to the parent vector.
 
FixedPoint index
 The encrypted index value.
 
size_t p_index
 Plaintext index (used if encrypted_index is false).
 
bool encrypted_index
 Flag indicating if the index is encrypted.
 

Friends

std::ostream & operator<< (std::ostream &out, const Eitem< T, U > &item)
 Stream insertion operator to handle direct printing of proxy items.
 

Detailed Description

template<typename T, typename U>
class computefhe::Eitem< T, U >

Proxy object for accessing and modifying elements in an Evector using encrypted indices.

Eitem acts as a bridge between the vector and encrypted logic. When an operation is performed on an Eitem initialized with an encrypted index, the library performs the operation across all elements of the underlying vector using multiplexers (MUX) to ensure the secret index is not leaked.

Template Parameters
TThe encrypted type stored in the vector (i.e., Einteger).
UThe corresponding plaintext type for constant operations.

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