30 template <
typename T>
class Evector;
45 template <
typename T,
typename U>
class Eitem {
64 typename = std::enable_if_t<std::is_constructible_v<V, T> &&
65 !std::is_same_v<V, T>>>
67 return V(
operator T());
80 T operator+(
const T &b)
const;
81 T operator+(U b)
const;
82 T operator-(
const T &b)
const;
83 T operator-(U b)
const;
84 T operator*(
const T &b)
const;
85 T operator*(U b)
const;
86 T operator/(
const T &b)
const;
87 T operator/(U b)
const;
88 T operator%(
const T &b)
const;
89 T operator%(U b)
const;
94 T operator&(
const T &b)
const;
95 T operator&(U b)
const;
96 T operator|(
const T &b)
const;
97 T operator|(U b)
const;
98 T operator^(
const T &b)
const;
99 T operator^(U b)
const;
104 Einteger operator==(
const T &b)
const;
106 Einteger operator!=(
const T &b)
const;
108 Einteger operator>(
const T &b)
const;
110 Einteger operator>=(
const T &b)
const;
112 Einteger operator<(
const T &b)
const;
114 Einteger operator<=(
const T &b)
const;
120 T operator&&(
const T &b)
const;
121 T operator&&(U b)
const;
122 T operator||(
const T &b)
const;
123 T operator||(U b)
const;
129 T operator>>(
int b)
const;
169 return out << static_cast<T>(item);
176 template <
typename T>
class Evector :
public std::vector<T> {
178 using std::vector<T>::vector;
179 using std::vector<T>::operator[];
199 typename = std::enable_if_t<std::is_integral_v<Integral>>>
201 return this->
at(
static_cast<size_t>(
idx));
210 using std::vector<
Einteger>::vector;
211 using std::vector<
Einteger>::operator[];
225 typename = std::enable_if_t<std::is_integral_v<Integral>>>
227 return this->
at(
static_cast<size_t>(
idx));
251 typename = std::enable_if_t<std::is_integral_v<Integral>>>
253 return this->
at(
static_cast<size_t>(
idx));
260 template <
size_t N,
size_t F,
bool S>
280 typename = std::enable_if_t<std::is_integral_v<Integral>>>
282 return this->
at(
static_cast<size_t>(
idx));
Defines the encrypted fixed-point number representation and operations.
Template class for fixed-precision encrypted real numbers.
Definition Efixedpoint.h:336
Represents an encrypted fixed-point number.
Definition Efixedpoint.h:27
Represents an encrypted integer.
Definition Einteger.h:27
Proxy object for accessing and modifying elements in an Evector using encrypted indices.
Definition Evector.h:45
bool encrypted_index
Flag indicating if the index is encrypted.
Definition Evector.h:50
FixedPoint index
The encrypted index value.
Definition Evector.h:48
friend std::ostream & operator<<(std::ostream &out, const Eitem< T, U > &item)
Stream insertion operator to handle direct printing of proxy items.
Definition Evector.h:167
size_t p_index
Plaintext index (used if encrypted_index is false).
Definition Evector.h:49
const T & operator=(U value)
Assignment operator from a plaintext value: converts to T using vector element metadata and then upda...
Eitem(Evector< T > &vec, const size_t idx)
Constructs a proxy item using a plaintext index.
const T & operator=(const T &value)
Assignment operator: conditionally updates vector elements based on the index.
Evector< T > & data
Reference to the parent vector.
Definition Evector.h:47
Eitem(Evector< T > &vec, const Einteger &idx)
Constructs a proxy item using an encrypted index.
EFix< N, F, S > & operator[](Integral idx)
Access element using a plaintext index.
Definition Evector.h:281
Eitem< Efixedpoint, double > operator[](const Einteger &index)
Access element using an encrypted index.
Definition Evector.h:270
Eitem< Efixedpoint, double > operator[](const Einteger &index)
Access element using an encrypted index.
Definition Evector.h:243
Efixedpoint & operator[](Integral idx)
Access element using a plaintext index.
Definition Evector.h:252
Eitem< Einteger, uint64_t > operator[](const Einteger &index)
Access element using an encrypted index.
Definition Evector.h:217
Einteger & operator[](Integral idx)
Access element using a plaintext index.
Definition Evector.h:226
General template for Evector.
Definition Evector.h:176
T & operator[](Integral idx)
Access element using a plaintext integral index. Overloads standard std::vector access to return a di...
Definition Evector.h:200
Eitem< Einteger, uint64_t > operator[](const Einteger &index)
Access element using an encrypted index.
Definition Evector.h:186
A bit-vector representation of an encrypted or plaintext word.
Definition FixedPoint.h:118