TFHE: Fast Fully Homomorphic Encryption for Boolean Circuits

TFHE (Torus Fully Homomorphic Encryption) takes a different approach than BFV or CKKS. Instead of operating on large integers or real numbers, TFHE efficiently computes on individual bits. This makes it exceptionally fast for certain types of computation.

The Boolean Approach

Traditional FHE schemes batch many values and perform parallel operations. TFHE instead:

TFHE Gate Speed

A single TFHE gate evaluation takes approximately 10-20 milliseconds on CPU. With GPU acceleration, this drops to microseconds per gate.

How TFHE Works

TFHE uses Learning With Errors over the torus (continuous circle group). Key innovations:

The programmable bootstrapping is particularly powerful—it simultaneously reduces noise and computes a lookup table function.

TFHE vs BFV/CKKS

Different strengths for different use cases:

TFHE excels when you need operations that are hard to express as polynomials—like comparisons and max/min functions.

Use Cases

Private Comparisons

Comparing encrypted values is natural in TFHE:

// Compare two encrypted 8-bit integers
encrypted_a_greater = compare(encrypted_a, encrypted_b);
// Returns encrypted bit: 1 if a > b, 0 otherwise

Conditional Logic

If-then-else on encrypted conditions:

// Encrypted multiplexer
result = mux(encrypted_condition, encrypted_if_true, encrypted_if_false);

Private Database Queries

TFHE enables encrypted SQL-like operations with range queries and comparisons.

Implementation Libraries

Several high-quality TFHE implementations exist:

Combining with Other Schemes

Advanced applications sometimes combine schemes:

This hybrid approach gets the best of each scheme's strengths.

Performance Optimization

To maximize TFHE performance:

TFHE's gate-by-gate approach offers unique advantages for computations requiring comparisons and conditionals. It's a powerful tool in the FHE toolkit.

Ready to Go Quantum-Secure?

Start protecting your users with post-quantum authentication today. 1,000 free auths, no credit card required.

Get Free API Key →