Possible values for ScalingModSize in BFV

Hello.

I am trying to use BFV for encrypting vectors which can contain values \{-1, 0, 1\}. The use case is for multiparty with 3 Clients. The Version being used in the Python wrapper.

I have been experimenting with different bit sizes for SetScalingModSize. When I use 50 bits or more the results are as expected, but when I try to use lower values such as 49 the results are not correct.

The parameters I am using are:

  • Security Level: SecurityLevel.HEStd_128_classic
  • Multiplicative Depth: 0
  • Ring Dimension: 2^13
  • Plaintext modulus 65537
  • Keyswitching technique: BV
  • ThresholdNumParties: 3
  • EvalAddCount: 2
  • KeySwitchCount: 0
  • MultipartyMode: NOISE_FLOODING_MULTIPARTY

As an example, for ScalingModSize 49, even when simply encrypting and decrypting a vector without doing any operation I get

  • Plaintext #1: [1, -1, 0, 0, 1, 0, 1, 0, -1, -1, 0, -1, -1, 1, 0, -1]
  • Dec of ct1: [0, -257, -129, 0, -65, 64, 64, 0, 0, 0, -65, 0, 0, -129, -65, 0]

I have tried different plaintext modulus and both Packed encoding and CoefPacked encoding, since I only need addition, but 49 bits or lower ScalingModSize always gives wrong results.

Any help is apreciated, thanks in advance.

Thank you for reporting the bug. I was able to recreate it. I’ve created an issue for this: Decryption failure for HPS* modes of BFV in the multiparty setting · Issue #1137 · openfheorg/openfhe-development · GitHub

Thank you for the reply.