# Emulating Using a Larger Ciphertext Modulus Size in Bootstrapping

**URL:** <https://openfhe.discourse.group/t/emulating-using-a-larger-ciphertext-modulus-size-in-bootstrapping/1505>\
**Category:** Library Questions\
**Tags:** questions\
**Created:** [August 21, 2024, 1:42pm UTC](https://openfhe.discourse.group/t/emulating-using-a-larger-ciphertext-modulus-size-in-bootstrapping/1505 "2024-08-21T13:42:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seyda](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/seyda/32/397_2.png) [@seyda](https://openfhe.discourse.group/u/seyda)\
**Post date:** [August 21, 2024, 1:42pm UTC](https://openfhe.discourse.group/t/emulating-using-a-larger-ciphertext-modulus-size-in-bootstrapping/1505/1 "2024-08-21T13:42:31Z")

</div>

In ckksrns-fhe.cpp line 477, the following function is called in FHECKKSRNS::EvalBootstrap:

` AdjustCiphertext(raised, correction);`

where the correction factor is calculated using the plaintext modulus, ciphertext modulus, and m\_correctionFactor. To my understanding, this Adjust Ciphertext code is specific to use inside FHECKKSRNS::EvalBootstrap. FHECKKSRNS::AdjustCiphertext has the following lines (2117-2024 in ckksrns-fhe.cpp):

```auto
// Scaling down the message by a correction factor to emulate using a larger q0.
// This step is needed so we could use a scaling factor of up to 2^59 with q9 ~= 2^60.
double adjustmentFactor = (targetSF / sourceSF) * (modToDrop / sourceSF) * std::pow(2, -correction);
cc->EvalMultInPlace(ciphertext, adjustmentFactor);

```

My question is, when an actually small ciphertext modulus size is used (in my case, I set Scaling mod size to 20 for experimenting), this step may result in a ciphertext of zeros, when the correction factor becomes large and makes the adjustmentFactor small. Changing the plaintext modulus size did not help. What should I do in this case? Is using such small ciphertext modulus size is always prohibited?  
Thank you so much in advance.

---

<div class="post-metadata">

**Author:** ![andreea.alexandru](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/andreea.alexandru/32/378_2.png) [@andreea.alexandru](https://openfhe.discourse.group/u/andreea.alexandru)\
**Post date:** [August 21, 2024, 2:49pm UTC](https://openfhe.discourse.group/t/emulating-using-a-larger-ciphertext-modulus-size-in-bootstrapping/1505/2 "2024-08-21T14:49:45Z")

</div>

Scaling moduli this small cannot give you precision in bootstrapping. Here are some other posts explaining this issue. [Setting security parameters according to 128 bit security (very small CKKS scaling factor) - #7 by ypolyakov](https://openfhe.discourse.group/t/setting-security-parameters-according-to-128-bit-security-very-small-ckks-scaling-factor/396/7), [How to calculate manually Error : Degree [X] must be less than or equal to the correction factor [Y]](https://openfhe.discourse.group/t/how-to-calculate-manually-error-degree-x-must-be-less-than-or-equal-to-the-correction-factor-y/1302)

By the way, the plaintext modulus has no meaning in CKKS (it is only used in BGV/BFV; the README in the latest version explains the cryptocontext parameters for each scheme). If you want to test code efficiently (rather than full size and security) it is better to keep the ciphertext moduli the full size, but work with a small ring dimension.
