Transciphering with CKKS

Hi,
I am currently trying to implement a transciphering scheme in the style of https://eprint.iacr.org/2020/1335.pdf using the openFHE library.

Concretely, I have to compute a symmetric keystream while performing the operations under BFV encryption, and then switch encryption scheme from BFV to CKKS. I have 3 loosely related question concerning this:

  1. Is there an easy way to switch between BFV and CKKS? In particular, since we can set ciphertext modulus and dimension to the same value, it is in theory possible to generate a single key pair. However, it appears that the keys are signed by the crypto-contexts, making it difficult to do in practice.

  2. The paper requires a SlotsToCoeff operation with BFV (which may be avoided a the cost of an additional encoding). A thread from a year ago mention that bootstrapping for BFV is on its way, do you know if it will appear in the near future, or should I try to find some alternative?
    The thread: BGV/BFV Bootstrapping

  3. The process requires overall a multiplicative depth of 12 + anything needed for the CKKS-homomorphic decryption of the BFV ciphertext. Is there any good choice of parameters allowing such a depth of calculation with BFV with a reasonably large PlainTextModulus?
    It is very easy to hit an infinite modulus (more than 2^1024 I guess) if the parameters are chosen poorly. In particular, with ring dimension 2^16 and lambda = 128, extrapolating the homomorphic encryption standards shows that log(Q)=1600 is admissible.

Thanks a lot in advance

  1. Indeed, the key structure is cryptocontext dependent, so BFV and CKKS will each have a key pair. In principle, you could modify the internals of OpenFHE if you want to set the keys differently, but since the CKKS scheme and the BFV scheme might have different ciphertext moduli based on the specified parameters, you need to be careful. Currently, you could convert between the keys by creating a key switch hint using KeySwitchGen and KeySwitch.

  2. Bootstrapping for BFV is not yet available. The SlotsToCoeff operation is a homomorphic linear transform/NTT, that you could try to implement yourself.

  3. You can set different depths and desired plaintext moduli sizes when generating the BFV cryptocontext and evaluate the returned ciphertext modulus and ring dimension in terms of your efficiency requirements.