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.62k stars 711 forks source link

“encoded values are too large“ in CKKS #570

Closed clearlovel7 closed 2 years ago

clearlovel7 commented 2 years ago

I find the value always mod modulus in BFV,and the modulus is associated with plain_modulus. But in Ckks, it have no plain_modulus ,and the double can't mod. So I don‘t konw how to deal with the big number. And I directly encode the big number. It thrown an error:“encoded values are too large“. How can I fix this problem?

WeiDaiWD commented 2 years ago

Check 5_ckks_basics. In CKKS, real numbers (or double) are multiplied by a scale then rounded to the nearest integer; there is no modular reduction. The maximum integer that can be presented is capped by coeff_modulus. So in your case, either make coeff_modulus larger (adding more primes), or make scale smaller.

clearlovel7 commented 2 years ago

Check 5_ckks_basics. In CKKS, real numbers (or double) are multiplied by a scale then rounded to the nearest integer; there is no modular reduction. The maximum integer that can be presented is capped by coeff_modulus. So in your case, either make coeff_modulus larger (adding more primes), or make scale smaller.

thanks for you reply!