Python implementation of the BFV scheme of FHE. Only for educational purposes.
- Introduction to the BFV FHE Scheme
- Revisiting Homomorphic Encryption Schemes for Finite Fields.
- Somewhat Practical Fully Homomorphic Encryption
- An Improved RNS Variant of the BFV Homomorphic Encryption Scheme
- Jay's explanation
python3 -m unittest discover tests
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 for testing purposes.
The script will run through the following steps:
- Secret key generation
- Public key generation
- Encryption of a random message to generate the ciphertext
- Decryption of the ciphertext to generate the plaintext
- Assertion of the equality between the plaintext and the original message
- Generation of the json file
python3 cli.py --help
python3 cli.py -n 1024 -q 1152921504606584833 -t 65537 --output input.json