This project has been archived by its maintainers, and is no longer receiving any updates.
What is this
This is a variant of Desilo/liberate-fhe with better typing, optimized GPU kernels and some user friendly features. This fork has left fork network and will not return to the original branch.
Pre-requisites
- Python 3.10 or later.
- CUDA 11 or later, CUDA 12+ is recommended.
nvccis required for compiling, please make sure it is in yourPATH. - PyTorch 2.0 or later is required.
Install
conda create -n tiberate python=3.12
conda activate tiberate
pip install tiberate --verbose
The install process may take long time depending on your machine. Using verbose flag will help you to see the progress.
Dev
For dev or edible installation, you can install from source.
# clone the repository
git clone https://github.com/visualDust/tiberate-fhe.git
cd tiberate-fhe
# create conda env
conda create -n tiberate python=3.12
conda activate tiberate
# build and install
pip install --editable . --verbose
Usage
import torch
from tiberate import CkksEngine
from tiberate.typing import Plaintext, Ciphertext
from vdtoys.plot import diff_distribution
# Engine creation
engine = CkksEngine()
print(engine)
# Some dummy data
data = torch.randn(8192)
# Encrypt some data
ct = engine.encodecrypt(data)
# Some plaintext with cache
pt = Plaintext(data)
# Save and load ciphertext
ct.save("./ct.pt")
ct = Ciphertext.load("./ct.pt")
# Operations with plaintext
ct = engine.pc_mult(pt, ct) # Multiplication
ct = engine.pc_add(pt, ct) # Addition
print(pt) # Print the plaintext information
# Ciphertext operations
ct = engine.cc_mult(ct, ct) # Multiplication
ct = engine.cc_add(ct, ct) # Addition
ct = engine.rotate_single(ct, engine.rotk[1]) # Rotation
ct = engine.rotate_single(ct, engine.rotk[-1]) # Rotate back
# Decryption
whatever = engine.decryptcode(ct, is_real=True)
# Error distribution
data = data * data + data
data *= data
data += data
diff = data - whatever[:8192]
print(f"Mean: {diff.mean()}, Std: {diff.std()}")
plt = diff_distribution(diff)
plt.show()
Run benchmarks
To run benchmarks, you can use the tiberate benchmark command:
tiberate benchmark
This will list all available benchmarks and their options. You can run a specific benchmark by providing its file path:
tiberate benchmark --file path/to/your_benchmark.py
Metadata
Release files for tiberate 0.9.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tiberate-0.9.11.tar.gz | 115.7 kB | With provenance | Details for tiberate-0.9.11.tar.gz |
Release files / tiberate-0.9.11.tar.gz
| Download URL | tiberate-0.9.11.tar.gz |
|---|---|
| Size | 115.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea1197fefae63a2e14447af84d1a6be61c7eb93197d54af24a1926e570694e36
|
|
BLAKE2b-256 checksum How to use checksums |
3ea67cc17f7f6c9aac29bcecbb58bd484ae81ceba924d662f916c3f302747820
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logSecurity for tiberate 0.9.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for tiberate-0.9.11.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.