ComputeFHE 1.0
General-Purpose Privacy-Preserving Computation Library for TFHE
Loading...
Searching...
No Matches
Classes | Macros
ConditionManager.h File Reference

Manages conditional execution state and branch tracking for encrypted operations. More...

#include <computefhe/FixedPoint.h>
#include <stack>
#include <unordered_map>
Include dependency graph for ConditionManager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  computefhe::ConditionalVar
 Internal tracking structure for encrypted variables in conditional blocks. More...
 
class  computefhe::ConditionManager
 Manages conditional execution state and variable multiplexing. More...
 

Macros

#define Eif(cond)
 Encrypted conditional branching macro (FHE-compatible "if").
 

Detailed Description

Manages conditional execution state and branch tracking for encrypted operations.

Macro Definition Documentation

◆ Eif

#define Eif (   cond)
Value:
for (ConditionManager _m((cond).getData()[0]); !_m.done(); \
_m.next_state()) \
if (_m.if_state())

Encrypted conditional branching macro (FHE-compatible "if").

This macro provides a high-level syntax for conditional logic on encrypted data. Because FHE ciphertexts cannot be used in standard C++ control flow statements without decryption, this macro uses a state machine (ConditionManager) to execute logic and then multiplex the results.

@important This macro is strictly intended for modifying encrypted types (e.g., Einteger, Efixedpoint, Euint8 etc). Ordinary, unencrypted C++ variables (like int, float, or bool) should not be modified inside an Eif block.

Nested Eif and else statements are fully supported.

Usage example:

Eif(encrypted_bool) {
// Logic executed if encrypted_bool is true
} else {
// optional
}
#define Eif(cond)
Encrypted conditional branching macro (FHE-compatible "if").
Definition ConditionManager.h:47
Parameters
condAn encrypted boolean representing the condition.