Automaticly find a good Plaintext Modulus

No, this is the recommended approach. The plaintext modulus depends on the application. At a high level, the plaintext modulus should be large enough not to cause a wrap-around for the worst case of user application. I recommend watching Homomorphic Encryption for OpenFHE Users – OpenFHE.org for more details. Slide 15 is the one that describes the logic.

For m, you can use 131,072 to make sure it is compatible with any ring dimension.

2 Likes