ibarrond / Pyfhel

PYthon For Homomorphic Encryption Libraries, perform encrypted computations such as sum, mult, scalar product or matrix multiplication in Python, with NumPy compatibility. Uses SEAL/PALISADE as backends, implemented using Cython.
https://pyfhel.readthedocs.io/
Apache License 2.0
475 stars 78 forks source link

Comparison of CKKS scheme between Pyfhel and TenSeal #249

Open Rahn80643 opened 1 month ago

Rahn80643 commented 1 month ago

Hi,

I’m trying to compare CKKS scheme between Pyfhel and TenSeal in Python. The experiment settings are:

128 security level Polynomial degree (N) = 8192 First Mod Size (Q0) = 60 Scaling Mod Size = 49 Multiplicative depth = 2 Two float arrays, each has 1000 elements. One constant The following execution time are measured:

Enc: encode + encrypt AddCC: add two ciphertext MultCC: multiply two ciphertext MultCConst: multiply one ciphertext and a constant DecAddCC: decrypt AddCC DecMultCC: decrypt MultCC DecMultCConst: decrypt MultCConst Each operation is executed 500 times and taken average with 12th Gen Intel® Core™ i7-12700KF CPU.

Based on the result, time taken for Pyfhel is longer than TenSeal, especially for decryption.

tenseal_pyfhel

May I ask what may be the potential cause that makes Pyfhel takes more time compared to TenSeal?

Thank you