tfhe-rs  by zama-ai

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

created 2 years ago
1,332 stars

Top 30.8% 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

1 day ago

Responsiveness

1 day

Pull Requests (30d)
118
Issues (30d)
2
Star History
192 stars in the last 90 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Yury Selivanov Yury Selivanov(Cofounder of Gel; Core Contributor to CPython, asyncio), and
2 more.

helix-db by HelixDB

1.5%
2k
Graph-vector database for RAG and AI applications
created 8 months ago
updated 1 day ago
Feedback? Help us improve.