tfhe-rs  by zama-ai

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

Created 3 years ago
1,565 stars

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

2 days ago

Responsiveness

1 day

Pull Requests (30d)
50
Issues (30d)
3
Star History
22 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Georgios Konstantopoulos Georgios Konstantopoulos(CTO, General Partner at Paradigm), and
1 more.

rig by 0xPlaygrounds

1.7%
5k
Rust library for building LLM-powered applications
Created 1 year ago
Updated 1 day ago
Feedback? Help us improve.