tfhe-rs  by zama-ai

Rust library for boolean/integer arithmetics over encrypted data using TFHE

Created 2 years ago
1,398 stars

Top 29.0% on SourcePulse

GitHubView on GitHub
Project Summary

TFHE-rs is a pure Rust implementation of the TFHE homomorphic encryption scheme, offering APIs for boolean and integer arithmetic over encrypted data. It targets developers and researchers seeking a high-performance, production-ready library for advanced TFHE features, providing control without low-level implementation burdens.

How It Works

TFHE-rs implements Zama's variant of TFHE, including programmable bootstrapping. It supports a boolean API for drop-in replacement and a short integer API for exact, unbounded FHE integer arithmetic up to 8 bits. The library emphasizes size-efficient public-key encryption and ciphertext/server key compression for efficient data transfer.

Quick Start & Requirements

  • Install via Cargo: tfhe = { version = "*", features = ["boolean", "shortint", "integer"] }
  • Requires Rust version >= 1.84.
  • AArch64 Windows is not supported due to missing entropy source.
  • Run examples with cargo run --release.
  • Documentation:
  • Handbook:
  • Tutorials:

Highlighted Details

  • Implements TFHE boolean API and short integer API for exact, unbounded FHE integer arithmetic.
  • Offers full Rust API, C bindings, and client-side WASM API.
  • Supports size-efficient public key encryption and key compression.
  • Stable v1.0.0 released February 2025 for x86 CPU backend.

Maintenance & Community

  • Community support available via Discord/Slack.
  • Contributions welcome via issues or becoming an official contributor (requires CLA).
  • Zama is the primary developer.

Licensing & Compatibility

  • Licensed under BSD-3-Clause-Clear.
  • Free for development, research, prototyping, and experimentation.
  • Commercial use requires a separate patent license from Zama.

Limitations & Caveats

Side-channel attack mitigation is not yet implemented. The default security parameters for the GPU backend assume IND-CPA security and that decrypted results are not shared.

Health Check
Last Commit

14 hours ago

Responsiveness

1 day

Pull Requests (30d)
137
Issues (30d)
6
Star History
49 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.