Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KULeuven-COSIC/FINAL
The fully homomorhic encryption scheme based on NTRU and LWE.
https://github.com/KULeuven-COSIC/FINAL
Last synced: 3 months ago
JSON representation
The fully homomorhic encryption scheme based on NTRU and LWE.
- Host: GitHub
- URL: https://github.com/KULeuven-COSIC/FINAL
- Owner: KULeuven-COSIC
- License: mit
- Created: 2022-01-18T14:12:56.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-06T12:35:40.000Z (over 2 years ago)
- Last Synced: 2024-04-07T05:31:57.436Z (7 months ago)
- Language: C++
- Size: 105 KB
- Stars: 27
- Watchers: 8
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-fhe - FINAL - C++ FHE library based on [NTRU and LWE scheme](https://eprint.iacr.org/2022/074). (Libraries / [Sunscreen](https://sunscreen.tech/))
- awesome-he - FINAL - C++ FHE library based on [NTRU and LWE scheme](https://eprint.iacr.org/2022/074). (Libraries)
README
# FINAL
## Faster FHE instantiated with NTRU and LWE
The FINAL library contains the implementation of the fully homorphic encryption schemes
presented in the paper ["FINAL: Faster FHE instantiated with NTRU and LWE"](http://eprint.iacr.org/2022/074),
by Charlotte Bonte (), Ilia Iliashenko (), Jeongeun Park (), Hilder V. L. Pereira (), and Nigel P. Smart ().It is distributed under the MIT license. Please, check the LICENSE file for more details.
### Requirements
A C++ compiler, the [NTL](https://libntl.org) and [FFTW 3](http://www.fftw.org) libraries.
## Run the code
1. Run `make` in the main repository folder.
2. Run the `test` program and check that all the homomorphic gates are computed correctly.## Usage
Use `test.cpp` and `Makefile` as reference points to create and compile your own program with FINAL.
### Example
```c++
// Input bits
int b1 = 0;
int b2 = 1;// LWE encryption base scheme
SchemeLWE s;
// LWE ciphertexts
Ctxt_LWE ct1, ct2, ct_or, ct_nand, ct_xor, ct_and, ct_not;
// Encryption of bits
s.encrypt(ct1, b1);
s.encrypt(ct2, b2);// Computes AND
s.and_gate(ct_and, ct1, ct2);
assert(s.decrypt(ct_and) == 0);
// Computes NAND
s.nand_gate(ct_nand, ct1, ct2);
assert(s.decrypt(ct_nand) == 1);
// Computes OR
s.or_gate(ct_or, ct1, ct2);
assert(s.decrypt(ct_or) == 1);
// Computes XOR
s.xor_gate(ct_xor, ct1, ct2);
assert(s.decrypt(ct_xor) == 1);
// Computes NOT
s.not_gate(ct_not, ct1);
assert(s.decrypt(ct_not) == 1);
```