Repolode
zama-ai

zama-ai/tfhe-rs

A pure Rust implementation of the TFHE scheme for performing boolean and integer arithmetic directly on encrypted data.

Stars
1,675
Forks
338
Open issues
54
Last commit
yesterday

What is it?

TFHE-rs is a pure Rust library implementing TFHE, a fully homomorphic encryption scheme. It lets a program compute on ciphertexts so that the results, once decrypted by the data owner, match what the same operations would produce on plaintext. Developers can use it for boolean circuits and for integer arithmetic on encrypted values of common widths such as FheUint8 and FheUint32.

The library provides a Rust high-level API, a C API, and a client-side JavaScript API compiled to WASM. It also includes a low-level cryptographic layer with programmable bootstrapping, a boolean API compatible with the original TFHE library, and a short integer API with exact unbounded arithmetic up to 8 bits of message space. Ciphertext and server key compression are supported to reduce data transfer size.

The project targets developers and researchers who need privacy-preserving computation without managing low-level cryptographic details. Its documentation, handbook and tutorials cover the underlying algorithms, parameter choices and example applications.

Key features

  • 01Boolean and integer arithmetic on encrypted data using TFHE.
  • 02High-level Rust API with encrypted integer types such as FheUint32.
  • 03C bindings and a client-side JavaScript API compiled to WASM.
  • 04Programmable bootstrapping in the low-level cryptographic layer.
  • 05Ciphertext and server key compression for smaller data transfer.

Use cases

  • Building privacy-preserving services that compute on data the server cannot read.
  • Prototyping encrypted integer or boolean circuits in research.
  • Running client-side encryption in browsers via the WASM API.

Quick start

  1. 1

    Check that your Rust version is 1.91.1 or newer

    rustc --version
  2. 2

    Add TFHE-rs as a dependency in Cargo.toml

    tfhe = { version = "*", features = ["boolean", "shortint", "integer"] }
  3. 3

    Run the example in release mode

    cargo run --release

Things to know

  • Licensed under BSD-3-Clause-Clear, which is limited to development, research, prototyping and experimentation; commercial use requires a separate patent license from Zama.
  • Side-channel attack mitigations are not yet implemented.
  • Requires Rust 1.91.1 or newer.
  • AArch64 machines are not supported on Windows.

In collections

Topics

FAQ

What is tfhe-rs?
A pure Rust implementation of the TFHE scheme for performing boolean and integer arithmetic directly on encrypted data. TFHE-rs is a pure Rust library implementing TFHE, a fully homomorphic encryption scheme. It lets a program compute on ciphertexts so that the results, once decrypted by the data owner, match what the same operations would produce on plaintext. Developers can use it for boolean circuits and for integer arithmetic on encrypted values of common widths such as FheUint8 and FheUint32.
Is tfhe-rs free to use? What license does it have?
tfhe-rs is open source under the Other license. Check the license terms before using it in commercial products.
Is tfhe-rs still maintained?
Actively maintained. The last commit to tfhe-rs was on Oct 23, 2026.
What can I use tfhe-rs for?
Building privacy-preserving services that compute on data the server cannot read. Prototyping encrypted integer or boolean circuits in research. Running client-side encryption in browsers via the WASM API.
How do I install tfhe-rs?
Check that your Rust version is 1.91.1 or newer: rustc --version Add TFHE-rs as a dependency in Cargo.toml: tfhe = { version = "*", features = ["boolean", "shortint", "integer"] } Run the example in release mode: cargo run --release
Where can I get tfhe-rs?
The source code and installation instructions are on GitHub: https://github.com/zama-ai/tfhe-rs

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects