26#include <openfhe/binfhe/binfhecontext.h>
29using namespace lbcrypto;
33 extern ComputeFHE *cfhe_base;
34 extern bool CLIENT_MODE;
48 ALUType alu_type = ALU_OPTIMIZED,
bool client_mode =
false,
49 bool simulation_mode =
false);
76 bool auto_encrypt_mode;
104 bool simulation_mode =
false);
Defines the optimized ALU implementation using specialized multi-input FHE gates.
Defines the standard ALU implementation using fundamental FHE logic gates.
Defines the abstract base class for functional ALU simulators.
Defines the abstract base class for FHE-based Arithmetic Logic Units.
Defines core enumerations and helper functions for ComputeFHE configuration.
ALUType
Specifies the logic gate implementation strategy.
Definition CFHETypes.h:94
CryptoContextParam
Supported cryptographic context parameters for OpenFHE.
Definition CFHETypes.h:32
void Finalize()
Shuts down the ComputeFHE environment and releases global resources.
void Init(CryptoContextParam cc_param=CCPARAM_STD128_3, ALUType alu_type=ALU_OPTIMIZED, bool client_mode=false, bool simulation_mode=false)
Initializes the global ComputeFHE environment and cryptographic context.
Manages conditional execution state and branch tracking for encrypted operations.
Defines the encrypted fixed-point number representation and operations.
Defines the encrypted integer representation and operations.
Provides vector containers with support for oblivious, encrypted indexing.
Defines the fundamental bit-level and bit-vector data structures for FHE operations.
Simulator implementation for optimized ALU operations.
Simulator implementation for standard ALU operations.
Abstract base class for functional ALU simulators.
Definition BaseALUSimulator.h:29
Abstract base class for FHE-based Arithmetic Logic Units.
Definition BaseALU.h:30
The core manager class for the ComputeFHE library.
Definition ComputeFHE.h:68
void SetLWEPrivateKey(const LWEPrivateKey &sk)
Sets the LWE Private Key.
~ComputeFHE()
Destructor. Cleans up ALU and context resources.
FixedPoint GetConstantInt(uint64_t pt, size_t n_digits=8)
Creates an unencrypted FixedPoint representation of an integer.
double extractNoise(ConstLWECiphertext &ct)
Estimates the noise magnitude within a specific bit.
BaseALU * GetALU()
Returns the active ALU implementation.
void PrintCryptoContextParams()
Prints the current cryptographic context settings to stdout.
void generateKeys()
Generates the secret key and switching keys for the context.
FixedPoint EncryptInt(uint64_t pt, size_t n_digits=8, bool fresh=true)
Encrypts a 64-bit integer into a FixedPoint bit-vector.
bool isAutoEncryptMode()
Checks if Auto-Encrypt mode is enabled.
ComputeFHE(CryptoContextParam param, ALUType alu_type, bool simulation_mode=false)
Constructs a ComputeFHE instance with specific parameters and ALU type.
BinaryDigit EncryptBool(bool pt, bool fresh=true)
Encrypts a single boolean value.
ComputeFHE(bool simulation_mode=false)
Constructs a ComputeFHE instance.
const LWEPrivateKey & GetLWEPrivateKey()
Returns the LWE Private Key. Requires CLIENT_MODE to be true.
ALUType GetALUType()
Returns the current ALU type (STANDARD or OPTIMIZED).
CryptoContextParam GetCryptoContextParam()
Returns the current cryptographic context parameters.
bool DecryptBool(const BinaryDigit &ct)
Decrypts a single BinaryDigit bit.
BinFHEContext & GetBinFHEContext()
Returns the underlying OpenFHE BinFHEContext.
uint64_t ConvertConstantInt(const FixedPoint &pt)
Converts a constant (unencrypted) FixedPoint back to a 64-bit integer.
BaseALUSimulator * GetSimulator()
Returns the simulator instance. Only valid in simulation mode. Returns nullptr if simulation mode is ...
uint64_t DecryptInt(const FixedPoint &ct, size_t n_digits=0)
Decrypts a FixedPoint bit-vector back into a 64-bit integer.
void PrintLWECiphertextParams(ConstLWECiphertext &ct)
Prints technical details about a specific LWE ciphertext to stdout.
ComputeFHE(ALUType alu_type, bool simulation_mode=false)
Constructs a ComputeFHE instance with a specific ALU type.
void setAutoEncryptMode(bool mode=true)
Sets the Auto-Encrypt mode.
ComputeFHE(CryptoContextParam param, bool simulation_mode=false)
Constructs a ComputeFHE instance with specific parameters.
A proxy-object representing a single bit that can behave as either a ciphertext or a plaintext.
Definition FixedPoint.h:35
A bit-vector representation of an encrypted or plaintext word.
Definition FixedPoint.h:118