15#include <openfhe/binfhe/binfhecontext.h>
18using namespace lbcrypto;
21#define COPY_CT(x) std::make_shared<LWECiphertextImpl>(*x)
82 template <
class Archive>
84 ar(cereal::make_nvp(
"c",
c));
85 ar(cereal::make_nvp(
"p",
p));
86 ar(cereal::make_nvp(
"is_ct",
is_ct));
89 template <
class Archive>
91 if (
version > SerializedVersion()) {
94 " is from a later version of the library");
96 ar(cereal::make_nvp(
"c",
c));
97 ar(cereal::make_nvp(
"p",
p));
98 ar(cereal::make_nvp(
"is_ct",
is_ct));
102 std::string SerializedObjectName()
const override {
103 return "BinaryDigit";
106 static uint32_t SerializedVersion() {
return 1; }
126 vector<BinaryDigit>::const_iterator
end);
Proxy object for accessing and modifying elements in an Evector using encrypted indices.
Definition Evector.h:45
A proxy-object representing a single bit that can behave as either a ciphertext or a plaintext.
Definition FixedPoint.h:35
BinaryDigit(const BinaryDigit &other)
Copy constructor.
BinaryDigit & operator=(LWEPlaintext pt)
Assigns a plaintext bit to the proxy and sets is_ct to false.
BinaryDigit(const LWECiphertext &ct)
Constructs a proxy from a ciphertext object.
BinaryDigit()
Default constructor.
bool is_ct
True if the object is currently acting as a ciphertext.
Definition FixedPoint.h:41
static uint new_id
Global static counter used to assign unique IDs.
Definition FixedPoint.h:37
BinaryDigit & operator=(const BinaryDigit &other)
Assignment from another BinaryDigit proxy.
LWECiphertext c
The underlying LWE ciphertext bit.
Definition FixedPoint.h:39
BinaryDigit(LWEPlaintext pt)
Constructs a proxy from a plaintext bit.
LWEPlaintext p
The underlying LWE plaintext bit.
Definition FixedPoint.h:40
bool operator==(const BinaryDigit &other) const
Compares two proxy bits for equality.
BinaryDigit(ConstLWECiphertext &ct)
Constructs a proxy from a constant ciphertext reference.
BinaryDigit(const ConstLWECiphertext &ct, LWEPlaintext pt, bool is_ct=false)
Constructs a proxy with specific ciphertext and plaintext values.
bool operator!=(const BinaryDigit &other) const
Compares two proxy bits for inequality.
BinaryDigit & operator=(const LWECiphertext &other)
Assigns a ciphertext bit to the proxy and sets is_ct to true.
A bit-vector representation of an encrypted or plaintext word.
Definition FixedPoint.h:118
FixedPoint(const vector< BinaryDigit > &other)
Constructs from an existing vector of BinaryDigit proxies.
bool is_ct() const
Determines if the bit-vector represents encrypted data.
FixedPoint()
Default constructor.
FixedPoint(const vector< LWEPlaintext > &other)
Constructs from a vector of plaintext bits.
FixedPoint(vector< BinaryDigit >::const_iterator begin, vector< BinaryDigit >::const_iterator end)
Constructs a bit-vector from a range of BinaryDigit proxies.
FixedPoint(std::initializer_list< BinaryDigit > list)
Constructs a bit-vector from an initializer list of bits.
FixedPoint(size_t n)
Constructs a bit-vector of size n.
FixedPoint(const vector< LWECiphertext > &other)
Constructs from a vector of LWE ciphertexts.