Ciphertext Modulus Calculation

Hello,

So I’m exploring various parameters for my thesis and can’t understand where and how OpenFHE calculates and chooses the ciphertext modulus.

So I would like to ask some questions:

  • How does OpenFHE calculate the ciphertext modulus based on the parameters I select (plaintext modulus, multiplicative depth, and ring dimension)?
  • Where in the library can I find the code where this happens?
  • How can I print the value of the ciphertext modulus?

Thanks in advance :slight_smile:

  1. Moduli choice in OpenFHE is fairly complicated, you would need to provide further details such as which scheme you are using. Check this paper (Algorithms 1-3) for some details.

  2. Depending on the scheme used, here is a pointer to the function that is used to initialize BFV parameters.

  3. You can refer to this thread to learn how to print out the ciphertext/public-key moduli.

1 Like

Hey, sorry for not specifying the scheme. I’m using BGV.

For BGV, you can study this function.