Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuriko627/bfv-py
BFV implementation in Python
https://github.com/yuriko627/bfv-py
Last synced: about 2 months ago
JSON representation
BFV implementation in Python
- Host: GitHub
- URL: https://github.com/yuriko627/bfv-py
- Owner: yuriko627
- License: mit
- Created: 2023-09-07T01:17:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-16T07:46:33.000Z (5 months ago)
- Last Synced: 2024-08-02T13:30:38.791Z (5 months ago)
- Language: Python
- Homepage:
- Size: 142 KB
- Stars: 21
- Watchers: 2
- Forks: 3
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BFV-PY
Python implementation of the BFV scheme of FHE. Only for educational purposes.
### Resources
- [Revisiting Homomorphic Encryption Schemes for Finite Fields](https://eprint.iacr.org/2012/144.pdf).
- [Somewhat Practical Fully Homomorphic Encryption](https://eprint.iacr.org/2021/204.pdf)
- [Jay's explanation](https://github.com/Janmajayamall/bfv/blob/notes/notes/BFV.md)### Test
```bash
$ python3 -m unittest discover -p '*_test.py'
```### Generate inputs for circuit
The following CLI interface is provided to generate a json file that will be used as input file for a circuit. This will be used in [zk-fhe](https://github.com/enricobottazzi/zk-fhe) for testing purposes.
The script will run through the following steps:
1. Secret key generation
2. Public key generation
3. Encryption of a random message to generate the ciphertext
4. Decryption of the ciphertext to generate the plaintext
5. Assertion of the equality between the plaintext and the original message
6. Generation of the json file```bash
$ python3 cli.py --help
$ python3 cli.py -n 1024 -q 536870909 -t 257 --output input.json
```