Hello everyone,
I’m currently struggling with understanding why my ciphertexts are not decrypting correctly.
The library API does not report any errors. Here is the minimal example:
#include <openfhe.h>
using namespace lbcrypto;
using namespace std;
#include <iostream>
int main(int argc, char *argv[]) {
CCParams<CryptoContextBFVRNS> parameters;
parameters.SetPlaintextModulus(1536369893834753); // prob has to do with this pmod, 51 bit
parameters.SetRingDim(65536); // log2 16
parameters.SetMultiplicativeDepth(2);
const auto cc = GenCryptoContext(parameters);
cc->Enable(PKE);
const auto keys = cc->KeyGen();
const auto pt = cc->MakePackedPlaintext({1, 2, 3, 4, 5, 6, 7, 8, 9});
const auto ct = cc->Encrypt(keys.publicKey, pt);
Plaintext pt_dc;
cc->Decrypt(keys.secretKey, ct, &pt_dc);
std::cout << "plain = " << pt_dc << std::endl;
}
When running this program it prints out a bunch of noise, whereas I would expect to see the output plain = (1, 2, 3, 4, 5, 6, 7, 8, 9, … ).
Running the same program with a smaller plaintext modulus (e.g. with FirstPrime(50, 131072)) does work as excepted.
Is this related to the plaintext limitation of the library, i.e. bigger plaintext modulus not working?
There was a similar question Big plaintext moduli, which mentioned approx 60 bit as a limit for the modulus. Could it be as low as 51 bit, maybe even related to the ring dimension, or am I missing something?
tested on v1.5.1, MATHBACKEND 4, NATIVE_SIZE 64, WITH_OPENMP OFF, WITH_NATIVEOPT ON.