-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Desilo/1-v090
update Liberate.FHE v0.9.0
- Loading branch information
Showing
59 changed files
with
19,874 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[flake8] | ||
max-line-length = 79 | ||
extend-ignore = E203 | ||
exclude = | ||
.venv,build,dist,docs,examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -543,7 +543,6 @@ Cargo.lock | |
########################### | ||
.python-version | ||
*.so | ||
*.lock | ||
etc | ||
cache | ||
#cache | ||
*.ipynb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,117 @@ | ||
# Liberate | ||
# Welcome to Liberate.FHE! | ||
|
||
Liberate.FHE is an open-source Fully Homomorphic Encryption (FHE) library for bridging the gap between theory and practice with a focus on performance and accuracy. | ||
|
||
Liberate.FHE is designed to be user-friendly while delivering robust performance, high accuracy, and a comprehensive suite of convenient APIs for developing real-world privacy-preserving applications. | ||
|
||
Liberate.FHE is a pure Python and CUDA implementation of FHE. So, Liberate.FHE supports multi-GPU operations natively. | ||
|
||
The main idea behind the design decisions is that non-cryptographers can use the library; it should be easily hackable and integrated with more extensive software frameworks. | ||
|
||
Additionally, several design decisions were made to maximize the usability of the developed software: | ||
|
||
- Make the number of dependencies minimal. | ||
- Make the software easily hackable. | ||
- Set the usage of multiple GPUs as the default. | ||
- Make the resulting library easily integrated with the pre-existing software, especially Artificial Intelligence ( | ||
AI) related ones. | ||
|
||
# Key Features | ||
|
||
- RNS-CKKS scheme is supported. | ||
- Python is natively supported. | ||
- Multiple GPU acceleration is supported. | ||
- Multiparty FHE is supported. | ||
|
||
# Quick Start | ||
|
||
```python | ||
from liberate import fhe | ||
from liberate.fhe import presets | ||
|
||
# Generate CKKS engine with preset parameters | ||
grade = "silver" # logN=14 | ||
params = presets.params[grade] | ||
|
||
engine = fhe.ckks_engine(**params, verbose=True) | ||
|
||
# Generate Keys | ||
sk = engine.create_secret_key() | ||
pk = engine.create_public_key(sk) | ||
evk = engine.create_evk(sk) | ||
|
||
# Generate test data | ||
m0 = engine.example(-1, 1) | ||
m1 = engine.example(-10, 10) | ||
|
||
# encode & encrypt data | ||
ct0 = engine.encorypt(m0, pk) | ||
ct1 = engine.encorypt(m1, pk, level=5) | ||
|
||
# (a + b) * b - a | ||
result = (m0 + m1) * m1 - m0 | ||
ct_add = engine.add(ct0, ct1) # auto leveling | ||
ct_mult = engine.mult(ct1, ct_add, evk) | ||
ct_result = engine.sub(ct_mult, ct0) | ||
|
||
# decrypt & decode data | ||
result_decrypted = engine.decrode(ct_result, sk) | ||
``` | ||
|
||
If you would like a detailed explanation, please refer to | ||
the [official documentation](https://docs.desilo.ai/liberate-fhe/getting-started/quick-start). | ||
|
||
# How to Install | ||
|
||
### Clone this repository | ||
|
||
```shell | ||
git clone https://github.com/Desilo/liberate.git | ||
``` | ||
|
||
### Install dependencies | ||
|
||
```shell | ||
poetry install | ||
``` | ||
|
||
### Run Cuda build Script. | ||
|
||
```shell | ||
python setup.py install | ||
# poetry run python setup.py install | ||
``` | ||
|
||
### Build a python package | ||
|
||
```shell | ||
poetry build | ||
``` | ||
|
||
### Install Liberate.FHE library | ||
|
||
```shell | ||
pip install . | ||
# poetry run python -m pip install . | ||
``` | ||
|
||
# Documentation | ||
|
||
Please refer to [Liberate.FHE](https://docs.desilo.ai/liberate-fhe/api-references/docs) for detailed installation | ||
instructions, examples, and documentation. | ||
|
||
|
||
# Citing Liberate.FHE | ||
|
||
```text | ||
@Misc{Liberate_FHE, | ||
title={{Liberate.FHE: A New FHE Library for Bridging the Gap between Theory and Practice with a Focus on Performance and Accuracy}}, | ||
author={DESILO}, | ||
year={2023}, | ||
note={\url{https://github.com/Desilo/liberate}}, | ||
} | ||
``` | ||
|
||
# License | ||
|
||
- Liberate.FHE is available under the *BSD 3-Clause Clear license*. If you have any questions, please contact us at [email protected]. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.