Closed ailanxier closed 1 year ago
The first behavior is expected. Setting the scaling mod size to 59 bits leaves no room for supporting larger values (higher than 1 or higher) in CKKS. Increasing the multiplicative depth one of the ways to fix it. Only the application developer knows the magnitude of encrypted messages. So OpenFHE cannot catch this as the underlying messages are encrypted.
For the second issue (a small scaling mod size), there is an issue already: https://github.com/openfheorg/openfhe-development/issues/339
In simple-real-numbers example,using
scaleModSize=59
(i.e., the default value of the CKKS scheme) leads to incorrect multiplication results, as shown below.The values of
4 * x1
andx1 * x2
are obviously incorrect. However, when changingmultDepth
to 2 (the original value in the example is 1), the values of4 * x1
andx1 * x2
are correct. There is no other prompt or error message during this process. IfscaleModSize
is used incorrectly, a corresponding prompt should be given.At the same time, I met a similar situation as #339 in the BGV scheme(simple-integers-bgvrns example). My code and result are as follows.
However, when I change
scaleModSize
to a larger value, such as 50, an error occurs.And I am not sure if it is necessary to set
scaleModSize
or callRescale()
in the BGV scheme. When I setparameters.SetScalingTechnique(FIXEDMANUAL);
in simple-integers-bgvrns example, I can get correct results without manually callingRescale()
, which confuses me. Thanks in advance for confirming and answering the above questions.