# BGV/BFV Bootstrapping

**URL:** <https://openfhe.discourse.group/t/bgv-bfv-bootstrapping/540>\
**Category:** Library Questions\
**Created:** [May 10, 2023, 2:45am UTC](https://openfhe.discourse.group/t/bgv-bfv-bootstrapping/540 "2023-05-10T02:45:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sijia](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Sijia](https://openfhe.discourse.group/u/Sijia)\
**Post date:** [May 10, 2023, 2:45am UTC](https://openfhe.discourse.group/t/bgv-bfv-bootstrapping/540/1 "2023-05-10T02:45:48Z")

</div>

Hi guys,

I’m currently investigating BGV/BFV bootstrapping.

It seems OpenFHE currently only supports CKKS bootstrapping. So, would BGV/BFV bootstrapping be included in future versions of OpenFHE?

Another thing I want to know is why BGV/BFV bootstrapping in the literature (Bootstrapping in Helib, etc) only provides a few packing slots. Normally, packing slots available in CKKS bootstrapping can be at most N/2, where N is the ring dimension, but BGV/BFV bootstrapping only has 128/64 slots. I’m wondering if that is the theoretical limit of BGV/BFV, or it was chosen to keep the bootstrapping algorithm simple or consume less multiplication depth?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [May 10, 2023, 2:35pm UTC](https://openfhe.discourse.group/t/bgv-bfv-bootstrapping/540/2 "2023-05-10T14:35:39Z")

</div>

Correct. Currently, OpenFHE includes the implementation of CKKS bootstrapping only. We do have a prototype implementation of BGV that is under development. This will be announced in future releases of OpenFHE once BGV/BFV bootstrapping is completed. Note that, BGV and BFV bootstrappings are very similar, as already stated in the resources below.

In BFV/BGV, the number of slots depends on the plaintext modulus and the underlying cyclotomic ring used to instantiate the scheme. Both define the structure of the underlying plaintext algebra and Galois group. The limitations on the number of slots used are mainly due to performance, since the plaintext modulus and cyclotomic ring modulus have a huge impact on bootstrapping complexity.

Further details can be found in this [work](https://eprint.iacr.org/2022/1363).  
I also recommend reading the following works:

1. [Bootstrapping for HElib](https://link.springer.com/article/10.1007/s00145-020-09368-7)
2. [Fully Homomorphic Encryption with Polylog Overhead](https://eprint.iacr.org/2011/566.pdf), in particular, Appendix C.
3. [Fully homomorphic SIMD operations](https://eprint.iacr.org/2011/133)

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [May 10, 2023, 8:37pm UTC](https://openfhe.discourse.group/t/bgv-bfv-bootstrapping/540/3 "2023-05-10T20:37:31Z")

</div>

Minor correction. OpenFHE also supports bootstrapping for FHEW (DM) and TFHE (CGGI) schemes. In these schemes, (programmable) bootstrapping is a “primitive” operation.

BGV and BFV are the only schemes in OpenFHE that do not currently support bootstrapping, as @Caesar mentioned. We do have a prototype, but still quite a bit of work is needed to add the BGV/BFV bootstrapping to OpenFHE properly.

---

<div class="post-metadata">

**Author:** ![Sijia](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Sijia](https://openfhe.discourse.group/u/Sijia)\
**Post date:** [May 11, 2023, 6:14am UTC](https://openfhe.discourse.group/t/bgv-bfv-bootstrapping/540/4 "2023-05-11T06:14:38Z")

</div>

Thank you for the informative reply!
