TFHE-rs implements Zama’s TFHE variant for encrypted boolean and short integer arithmetic, with Rust, C, and client WASM APIs.
Overview
TFHE-rs is a pure Rust implementation of the TFHE scheme for boolean gates and integer operations on encrypted data. It targets developers and researchers who want a stable, high-level API over the cryptographic core without managing low-level details themselves.
Capabilities include programmable bootstrapping, a boolean API compatible with other TFHE libraries, short integer arithmetic with up to eight bits of message space, compressed public keys and ciphertexts for transfer efficiency, and bindings for Rust, C, and JavaScript via WASM on the client side.
Consumers add the crate as a Cargo dependency and run examples with release builds for acceptable performance. Documentation covers tutorials, a technical handbook, security parameter notes, and optional Linux tuning for transparent huge pages when using many threads.
Security documentation discusses failure probabilities, IND-CPA-D parameter sets, lattice estimator updates, and notes that side-channel mitigations are planned for future releases. Commercial use may require a separate patent license from Zama per their FAQ.
Key features
- Boolean and short integer FHE APIs
- Programmable bootstrapping
- Public key encryption with compression
- Rust, C, and client WASM surfaces
- Cargo crate integration
- Documented security parameter sets
- Handbook and tutorial materials
- Drop-in style boolean API
Use cases
- Encrypted integer operations in Rust apps
- Privacy-preserving analytics prototypes
- Research on homomorphic encryption
- Client-side WASM encrypted workflows
- Boolean circuit evaluation on ciphertexts