Closed yspolyakov closed 10 months ago
When Compress is called for FLEXIBLEAUTO and FLEXIBLEAUTOEXT, it reduces the noise degree to 1 and then simply drops remaining RNS limbs (to the desired level). If all we do after this is decryption, this does not increase the approximation error.
If we use it before any flavor of bootstrapping, we need to multiply the ciphertext by the appropriate adjustment factor that will set the scaling factor for the destination level. See https://github.com/openfheorg/openfhe-development/blob/v1.1.2/src/pke/lib/scheme/ckksrns/ckksrns-multiparty.cpp#L143 and the adjustment logic right after it for an example.
No action is needed.
Currently the generic implementation in the base RNS scheme is used. We need to add special logic to update the scaling factor. This leads to precision loss of 3-4 bits.
For reference, see the implementation of CKKS Compress in PALISADE: https://gitlab.com/palisade/palisade-release/-/blob/master/src/pke/lib/scheme/ckks/ckks-impl.cpp?ref_type=heads#L1815