microsoft / SEAL

Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
https://www.microsoft.com/en-us/research/group/cryptography-research/
MIT License
3.46k stars 694 forks source link

Relationship between parameters and multiplication depth #661

Open LiangqinRen opened 9 months ago

LiangqinRen commented 9 months ago

Hello there! Thanks for the fantastic library. I have a project that needs to use the CKKS mode with about 11 consecutive multiplications. I have read examples and implemented my project. I want to make sure my thinking is correct. To my understanding, since I need 11 consecutive multiplications, I need a large poly_modulus_degree(32768) and coeff_modulus({60, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 60}). At the same time, poly_modulus_degree also enables 16384 batch operations, but I don't need that much, so it is a little bit wasteful for me. Therefore, is there any method to accelerate the process? Such as any method to avoid the large parameters but support 11 consecutive multiplications. Thanks for any helps.

minnow54426 commented 9 months ago

Hello, if you can tolerate lower precision, the modulus can be set smaller than 60(40) bit, then you get poly_modulus_degree(16384) for better performance. The detailed relation between polynomial length and total bits of modulus can be found in Tables of Recommended Parameters in Homomorphic Standand, you can also refer to #373 for help. If you want to try a parameter combination which doesn't satisfy the standard, refer to #453.