ComputeFHE 1.0
General-Purpose Privacy-Preserving Computation Library for TFHE
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
computefhe::BinaryDigit Struct Reference

A proxy-object representing a single bit that can behave as either a ciphertext or a plaintext. More...

#include <FixedPoint.h>

Inheritance diagram for computefhe::BinaryDigit:
Inheritance graph
[legend]
Collaboration diagram for computefhe::BinaryDigit:
Collaboration graph
[legend]

Public Member Functions

 BinaryDigit ()
 Default constructor.
 
 BinaryDigit (const BinaryDigit &other)
 Copy constructor.
 
 BinaryDigit (ConstLWECiphertext &ct)
 Constructs a proxy from a constant ciphertext reference.
 
 BinaryDigit (const LWECiphertext &ct)
 Constructs a proxy from a ciphertext object.
 
 BinaryDigit (LWEPlaintext pt)
 Constructs a proxy from a plaintext bit.
 
 BinaryDigit (const ConstLWECiphertext &ct, LWEPlaintext pt, bool is_ct=false)
 Constructs a proxy with specific ciphertext and plaintext values.
 
BinaryDigitoperator= (const BinaryDigit &other)
 Assignment from another BinaryDigit proxy.
 
BinaryDigitoperator= (const LWECiphertext &other)
 Assigns a ciphertext bit to the proxy and sets is_ct to true.
 
BinaryDigitoperator= (LWEPlaintext pt)
 Assigns a plaintext bit to the proxy and sets is_ct to false.
 
bool operator== (const BinaryDigit &other) const
 Compares two proxy bits for equality.
 
bool operator!= (const BinaryDigit &other) const
 Compares two proxy bits for inequality.
 
 operator LWECiphertext & ()
 Conversion operator to a mutable LWECiphertext reference.
 
 operator const LWECiphertext & () const
 Conversion operator to a constant LWECiphertext reference.
 
 operator ConstLWECiphertext () const
 Conversion operator to a ConstLWECiphertext wrapper.
 
 operator LWEPlaintext () const
 Conversion operator to LWEPlaintext.
 
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
 

Static Public Member Functions

static uint32_t SerializedVersion ()
 

Public Attributes

uint id = 0
 Unique identifier for this bit instance.
 
LWECiphertext c
 The underlying LWE ciphertext bit.
 
LWEPlaintext p
 The underlying LWE plaintext bit.
 
bool is_ct
 True if the object is currently acting as a ciphertext.
 

Static Public Attributes

static uint new_id
 Global static counter used to assign unique IDs.
 

Detailed Description

A proxy-object representing a single bit that can behave as either a ciphertext or a plaintext.

This struct facilitates transparent handling of bits within the library by wrapping OpenFHE's LWE types. It tracks whether the data is encrypted via the is_ct flag, allowing ALU operations to choose the appropriate cryptographic kernels.


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