# FHE Questions

**URL:** https://openfhe.discourse.group/c/fhe-questions/18.md?page=1

[Latest](https://openfhe.discourse.group/latest.md) · [Categories](https://openfhe.discourse.group/categories.md) · [Tags](https://openfhe.discourse.group/tags.md)

**Page:** 2

---

## [Effect of scaleModSize on Multiplication](https://openfhe.discourse.group/t/effect-of-scalemodsize-on-multiplication/1949)

<div class="topic-metadata">

**Author:** [@bhavinmoriya](https://openfhe.discourse.group/u/bhavinmoriya)\
**Replies:** 1\
**Last updated:** [March 21, 2025, 8:30pm UTC](https://openfhe.discourse.group/t/effect-of-scalemodsize-on-multiplication/1949 "2025-03-21T20:30:40Z")

</div>

HI, I have been studying multiplication in the following code, I have noticed that scaleModSize =50, gives perfect multiplication. However, scaleModSize =59 gives weird multiplication. The outputs are consistent – tha…

---

## [Sparse Secret Keys in the Literature](https://openfhe.discourse.group/t/sparse-secret-keys-in-the-literature/1948)

<div class="topic-metadata">

**Author:** [@seyda](https://openfhe.discourse.group/u/seyda)\
**Replies:** 5\
**Last updated:** [March 20, 2025, 8:23pm UTC](https://openfhe.discourse.group/t/sparse-secret-keys-in-the-literature/1948 "2025-03-20T20:23:17Z")

</div>

Hi all, I have a question on the Efficient Bottstrapping with Non-sparse Keys (Bossuat et al, 2022) paper. In Table III, they use a Hamming weight of up to N/2 (N: ring dimension), and not N? Why do we have to leave at …

---

## [What is the relationship between logQ and q of FHEW scheme parameters in ciphertext conversion?](https://openfhe.discourse.group/t/what-is-the-relationship-between-logq-and-q-of-fhew-scheme-parameters-in-ciphertext-conversion/1914)

<div class="topic-metadata">

**Author:** [@stone](https://openfhe.discourse.group/u/stone)\
**Replies:** 1\
**Last updated:** [March 10, 2025, 2:02pm UTC](https://openfhe.discourse.group/t/what-is-the-relationship-between-logq-and-q-of-fhew-scheme-parameters-in-ciphertext-conversion/1914 "2025-03-10T14:02:46Z")

</div>

Hello, what are the functions of the parameters Q and q of the FHEW scheme in the ciphertext conversion scheme? Please refer to the file scheme-switching.cpp

---

## [Help with parameter selection](https://openfhe.discourse.group/t/help-with-parameter-selection/1833)

<div class="topic-metadata">

**Author:** [@sp18](https://openfhe.discourse.group/u/sp18)\
**Replies:** 8\
**Last updated:** [February 3, 2025, 7:38pm UTC](https://openfhe.discourse.group/t/help-with-parameter-selection/1833 "2025-02-03T19:38:31Z")

</div>

I am trying to write a CKKS code and modify the parameters. Wanted to ask if there is way to set lower size for ciphertext modulus, as I set to lower ring dimensions. Wanted to understand how to go about it and should I …

---

## [Hybrid ks validity check](https://openfhe.discourse.group/t/hybrid-ks-validity-check/1837)

<div class="topic-metadata">

**Author:** [@yhh](https://openfhe.discourse.group/u/yhh)\
**Replies:** 1\
**Last updated:** [January 23, 2025, 2:53pm UTC](https://openfhe.discourse.group/t/hybrid-ks-validity-check/1837 "2025-01-23T14:53:42Z")

</div>

Hi! I am learning the implementation of Keyswtich, and i would like to know why we need to check whether sizeQ \<= (a \* (numPartQ - 1)) in the following part? // Compute ceil(sizeQ/numPartQ), the # of towers per…

---

## [Can we query an encrypted vector and output matching values?](https://openfhe.discourse.group/t/can-we-query-an-encrypted-vector-and-output-matching-values/1741)

<div class="topic-metadata">

**Author:** [@DenisRed](https://openfhe.discourse.group/u/DenisRed)\
**Replies:** 9\
**Last updated:** [January 13, 2025, 2:32pm UTC](https://openfhe.discourse.group/t/can-we-query-an-encrypted-vector-and-output-matching-values/1741 "2025-01-13T14:32:06Z")

</div>

Hey guys I’m still trying to figure out the possibilities i have with this library. I was wondering if I could also create some kind of “queries” to get values out of an encrypted vector, that match the condition. Just …

---

## [Can i use BFV/BGV instead of CKKS for float numbers](https://openfhe.discourse.group/t/can-i-use-bfv-bgv-instead-of-ckks-for-float-numbers/1829)

<div class="topic-metadata">

**Author:** [@DenisRed](https://openfhe.discourse.group/u/DenisRed)\
**Replies:** 1\
**Last updated:** [January 10, 2025, 12:20am UTC](https://openfhe.discourse.group/t/can-i-use-bfv-bgv-instead-of-ckks-for-float-numbers/1829 "2025-01-10T00:20:18Z")

</div>

Hello together, let’s think of a use case where we need to process vectors of floating point numbers. The first thought is to use CKKS. What CKKS is doing under the hood is scaling up to operate on integers. Theoretica…

---

## [What is the CKKS bootstrapping algorithm in openfhe?](https://openfhe.discourse.group/t/what-is-the-ckks-bootstrapping-algorithm-in-openfhe/1826)

<div class="topic-metadata">

**Author:** [@hionwi](https://openfhe.discourse.group/u/hionwi)\
**Replies:** 1\
**Last updated:** [January 10, 2025, 12:10am UTC](https://openfhe.discourse.group/t/what-is-the-ckks-bootstrapping-algorithm-in-openfhe/1826 "2025-01-10T00:10:24Z")

</div>

I am studying bootstrapping in CKKS recently. Could anyone give me some papers about CKKS bootstrapping?

---

## [Is secure comparison that efficient?](https://openfhe.discourse.group/t/is-secure-comparison-that-efficient/697)

<div class="topic-metadata">

**Author:** [@miiip](https://openfhe.discourse.group/u/miiip)\
**Replies:** 5\
**Last updated:** [January 5, 2025, 4:07am UTC](https://openfhe.discourse.group/t/is-secure-comparison-that-efficient/697 "2025-01-05T04:07:27Z")

</div>

Hi all, I know that many questions have been posted about this topic. What I don’t understand is how this paper can get such small times. The paper was referenced in this post. According to the authors: Blockquote O…

---

## [Implementation of square root approximation without Cheby](https://openfhe.discourse.group/t/implementation-of-square-root-approximation-without-cheby/1812)

<div class="topic-metadata">

**Author:** [@DenisRed](https://openfhe.discourse.group/u/DenisRed)\
**Replies:** 1\
**Last updated:** [December 30, 2024, 3:33pm UTC](https://openfhe.discourse.group/t/implementation-of-square-root-approximation-without-cheby/1812 "2024-12-30T15:33:25Z")

</div>

I tried to implement the algorithm for approximating the square root from https://eprint.iacr.org/2019/417.pdf Section 3.2 I know i can use chebyshev approximation but i tried to experiment with alternatives. auto c…

---

## [Toy example BV keyswitch](https://openfhe.discourse.group/t/toy-example-bv-keyswitch/1807)

<div class="topic-metadata">

**Author:** [@mmazz](https://openfhe.discourse.group/u/mmazz)\
**Replies:** 2\
**Last updated:** [December 28, 2024, 7:09pm UTC](https://openfhe.discourse.group/t/toy-example-bv-keyswitch/1807 "2024-12-28T19:09:01Z")

</div>

Hi! I’m trying to understand the BV keyswitch technique, in particular it RNS implementation. I read some articles, in particular appendix B of Revisiting Homomorphic Encryption Schemes for Finite Fields, but I can’t g…

---

## [Noise reduction in CKKS](https://openfhe.discourse.group/t/noise-reduction-in-ckks/1805)

<div class="topic-metadata">

**Author:** [@gogo9th](https://openfhe.discourse.group/u/gogo9th)\
**Replies:** 2\
**Last updated:** [December 26, 2024, 7:04am UTC](https://openfhe.discourse.group/t/noise-reduction-in-ckks/1805 "2024-12-26T07:04:01Z")

</div>

Hi, I read this article about CKKS noise reduction, explaining that we cannot reduce the noise ratio within a CKKS ciphertext relative to its ciphertext modulus: https://openfhe.discourse.group/t/ckks-relations-between…

---

## [How to merge several small CKKS ciphertexts into one large CKKS ciphertext](https://openfhe.discourse.group/t/how-to-merge-several-small-ckks-ciphertexts-into-one-large-ckks-ciphertext/1794)

<div class="topic-metadata">

**Author:** [@stone](https://openfhe.discourse.group/u/stone)\
**Replies:** 5\
**Last updated:** [December 24, 2024, 1:53am UTC](https://openfhe.discourse.group/t/how-to-merge-several-small-ckks-ciphertexts-into-one-large-ckks-ciphertext/1794 "2024-12-24T01:53:34Z")

</div>

Hello, may I ask how to https://eprint.iacr.org/2012/240.pdf convert the small ring dimension in this article to the original large ring dimension. Based on this question Looking forward to your reply very much.

---

## [Can BFV bootstrapping restore the multiplicative level?](https://openfhe.discourse.group/t/can-bfv-bootstrapping-restore-the-multiplicative-level/1797)

<div class="topic-metadata">

**Author:** [@gogo9th](https://openfhe.discourse.group/u/gogo9th)\
**Replies:** 3\
**Last updated:** [December 21, 2024, 1:36pm UTC](https://openfhe.discourse.group/t/can-bfv-bootstrapping-restore-the-multiplicative-level/1797 "2024-12-21T13:36:09Z")

</div>

Hi, I studied how BFV’s bootstrapping works based on this paper: https://eprint.iacr.org/2014/873.pdf However, the boostrapping method based on digit extraction seems to only reset the noise. In fact, noise resetting …

---

## [A question about digit extraction of BFV/BGV's bootstrapping](https://openfhe.discourse.group/t/a-question-about-digit-extraction-of-bfv-bgvs-bootstrapping/1788)

<div class="topic-metadata">

**Author:** [@gogo9th](https://openfhe.discourse.group/u/gogo9th)\
**Replies:** 1\
**Last updated:** [December 20, 2024, 6:30pm UTC](https://openfhe.discourse.group/t/a-question-about-digit-extraction-of-bfv-bgvs-bootstrapping/1788 "2024-12-20T18:30:52Z")

</div>

Hi, I am reading this paper to learn how BFV’s (and BGV’s) bootstrapping works. But I don’t understand how the digit extraction works. In the paper’s section: 5.3 Digit-Extraction for Plaintext Space Modulo p^r The ke…

---

## [Why the values q/8 and -q/8 are used to represent Boolean values in TFHE？](https://openfhe.discourse.group/t/why-the-values-q-8-and-q-8-are-used-to-represent-boolean-values-in-tfhe/1789)

<div class="topic-metadata">

**Author:** [@capibala](https://openfhe.discourse.group/u/capibala)\
**Replies:** 2\
**Last updated:** [December 20, 2024, 5:23am UTC](https://openfhe.discourse.group/t/why-the-values-q-8-and-q-8-are-used-to-represent-boolean-values-in-tfhe/1789 "2024-12-20T05:23:16Z")

</div>

Why not q/16 or q/4? And the implementation of AND is achieved by the following method. If q/16 is used with the appropriate OFFSET value, can’t it be used to implement multiple input AND gates?

---

## [How BGV's modulus switching works after multiplication?](https://openfhe.discourse.group/t/how-bgvs-modulus-switching-works-after-multiplication/1770)

<div class="topic-metadata">

**Author:** [@gogo9th](https://openfhe.discourse.group/u/gogo9th)\
**Replies:** 9\
**Last updated:** [December 19, 2024, 6:24am UTC](https://openfhe.discourse.group/t/how-bgvs-modulus-switching-works-after-multiplication/1770 "2024-12-19T06:24:10Z")

</div>

Hi, I have some difficulty in understanding how BGV’s modulus switching can preserve correctness after cipher-cipher multiplication. Suppose we have two BGV ciphertexts encrypting the following: Ciphertext 1: RLWE(M1 …

---

## [Understanding CKKS Moduli](https://openfhe.discourse.group/t/understanding-ckks-moduli/1782)

<div class="topic-metadata">

**Author:** [@malioboro](https://openfhe.discourse.group/u/malioboro)\
**Replies:** 2\
**Last updated:** [December 18, 2024, 9:36pm UTC](https://openfhe.discourse.group/t/understanding-ckks-moduli/1782 "2024-12-18T21:36:44Z")

</div>

I print my fresh ciphertext moduli that has depth 5, and it shows: Element 0 params: q0 = 2147352577 q1 = 1071513601 q2 = 1070727169 q3 = 1077477377 q4 = 1073479681 q5 = 1073872897 q6 = 786433 Element 1 pa…

---

## [What's the difference between automorphism and rotate](https://openfhe.discourse.group/t/whats-the-difference-between-automorphism-and-rotate/1763)

<div class="topic-metadata">

**Author:** [@capibala](https://openfhe.discourse.group/u/capibala)\
**Replies:** 1\
**Last updated:** [December 6, 2024, 3:30pm UTC](https://openfhe.discourse.group/t/whats-the-difference-between-automorphism-and-rotate/1763 "2024-12-06T15:30:17Z")

</div>

rotate in the source code calls automorphism

---

## [How to reduce the size of ckks ciphertext？](https://openfhe.discourse.group/t/how-to-reduce-the-size-of-ckks-ciphertext/290)

<div class="topic-metadata">

**Author:** [@hamm](https://openfhe.discourse.group/u/hamm)\
**Replies:** 11\
**Last updated:** [November 26, 2024, 4:44pm UTC](https://openfhe.discourse.group/t/how-to-reduce-the-size-of-ckks-ciphertext/290 "2024-11-26T16:44:38Z")

</div>

Hi！ I’m working on an encrypted database and want to store CKKS encrypted ciphertext in the database. But for a double type of data, the encrypted ciphertext has a size of 180,000 bits. I’m wondering how to modify to r…

---

## [Comparing two encrypted vectors of the same size with scheme switching gives wrong output](https://openfhe.discourse.group/t/comparing-two-encrypted-vectors-of-the-same-size-with-scheme-switching-gives-wrong-output/1732)

<div class="topic-metadata">

**Author:** [@DenisRed](https://openfhe.discourse.group/u/DenisRed)\
**Replies:** 3\
**Last updated:** [November 20, 2024, 2:50pm UTC](https://openfhe.discourse.group/t/comparing-two-encrypted-vectors-of-the-same-size-with-scheme-switching-gives-wrong-output/1732 "2024-11-20T14:50:58Z")

</div>

Hi together, my application is doing a EvalCompareSchemeSwitching operation on two encrypted vectors of the same size (they are results from previous fhe operations). The initial batch size is 8 but it will be manually …

---

## [Complex Optimization in Logistic Regression Training](https://openfhe.discourse.group/t/complex-optimization-in-logistic-regression-training/1703)

<div class="topic-metadata">

**Author:** [@seyda](https://openfhe.discourse.group/u/seyda)\
**Replies:** 3\
**Last updated:** [November 18, 2024, 2:21pm UTC](https://openfhe.discourse.group/t/complex-optimization-in-logistic-regression-training/1703 "2024-11-18T14:21:55Z")

</div>

Hello everyone, I have two questions regarding the logistic regression training using OpenFHE. First, what is the reason for using the Nesterov Accelerated Gradient Descent? Second, I encountered ‘training instabilitie…

---

## [I have some questions regarding CKKS scheme encoding, encryption and decryption after reading paper](https://openfhe.discourse.group/t/i-have-some-questions-regarding-ckks-scheme-encoding-encryption-and-decryption-after-reading-paper/1720)

<div class="topic-metadata">

**Author:** [@Jason](https://openfhe.discourse.group/u/Jason)\
**Replies:** 1\
**Last updated:** [November 15, 2024, 6:26pm UTC](https://openfhe.discourse.group/t/i-have-some-questions-regarding-ckks-scheme-encoding-encryption-and-decryption-after-reading-paper/1720 "2024-11-15T18:26:57Z")

</div>

I would be very grateful if you clear up my basic confusion regarding the CKKS scheme. While writing code, we use one function, MakePacketPlaintext (). It will convert our input vector into NTT eval form. However, in …

---

## [How to set batchsize and numslots dynamically](https://openfhe.discourse.group/t/how-to-set-batchsize-and-numslots-dynamically/1722)

<div class="topic-metadata">

**Author:** [@DenisRed](https://openfhe.discourse.group/u/DenisRed)\
**Replies:** 1\
**Last updated:** [November 14, 2024, 4:11pm UTC](https://openfhe.discourse.group/t/how-to-set-batchsize-and-numslots-dynamically/1722 "2024-11-14T16:11:59Z")

</div>

Hello guys, my OpenFHE application gets input vectors that are varying in size every time i run the code. So how can i set batchsize and numslots correctly in that scenario? Unfortunately, i have not yet fully understood…

---

## [CKKS Bootstrapping during multiplication gives weird output](https://openfhe.discourse.group/t/ckks-bootstrapping-during-multiplication-gives-weird-output/1696)

<div class="topic-metadata">

**Author:** [@bhavinmoriya](https://openfhe.discourse.group/u/bhavinmoriya)\
**Replies:** 3\
**Last updated:** [November 14, 2024, 3:22am UTC](https://openfhe.discourse.group/t/ckks-bootstrapping-during-multiplication-gives-weird-output/1696 "2024-11-14T03:22:59Z")

</div>

Hi, I have been playing with bootstrapping to multiply a given vector with 3. When I multiply by 3^20 the results get weird. May I know what is the problem. The code is a minor modification from the original code on Ope…

---

## [Where to start for FHE](https://openfhe.discourse.group/t/where-to-start-for-fhe/1686)

<div class="topic-metadata">

**Author:** [@khalid](https://openfhe.discourse.group/u/khalid)\
**Replies:** 1\
**Last updated:** [November 4, 2024, 2:29pm UTC](https://openfhe.discourse.group/t/where-to-start-for-fhe/1686 "2024-11-04T14:29:21Z")

</div>

Hello, I am new to FHE, construction, and its applications. I am working on PQC, particularly NIST and newly submitted digital signature schemes. I want to explore FHE schemes and their potential in real-life applicati…

---

## [How to get single elements out of an encrypted vector?](https://openfhe.discourse.group/t/how-to-get-single-elements-out-of-an-encrypted-vector/1676)

<div class="topic-metadata">

**Author:** [@DenisRed](https://openfhe.discourse.group/u/DenisRed)\
**Replies:** 1\
**Last updated:** [October 29, 2024, 7:52pm UTC](https://openfhe.discourse.group/t/how-to-get-single-elements-out-of-an-encrypted-vector/1676 "2024-10-29T19:52:50Z")

</div>

Hi all, for my Master’s Thesis i need to make computations with single elements out of a ciphertext vector. The plain vector and its encryption maybe looks like this: vector\<double\> reals = {52.5152, 13.6039, 4798.4587…

---

## [Noise Flooding Stage Questions](https://openfhe.discourse.group/t/noise-flooding-stage-questions/1673)

<div class="topic-metadata">

**Author:** [@malioboro](https://openfhe.discourse.group/u/malioboro)\
**Replies:** 2\
**Last updated:** [October 29, 2024, 7:50pm UTC](https://openfhe.discourse.group/t/noise-flooding-stage-questions/1673 "2024-10-29T19:50:55Z")

</div>

Hi, I am currently learning about Noise Flooding and how it is implemented in OpenFHE. Then, I saw this block in ckksrns-pke.cpp: DCRTPoly b = DecryptCore(cv, privateKey); if (cryptoParams-\>G…

---

## [How to determing the number of towers?](https://openfhe.discourse.group/t/how-to-determing-the-number-of-towers/388)

<div class="topic-metadata">

**Author:** [@lance](https://openfhe.discourse.group/u/lance)\
**Replies:** 4\
**Last updated:** [October 21, 2024, 8:43pm UTC](https://openfhe.discourse.group/t/how-to-determing-the-number-of-towers/388 "2024-10-21T20:43:49Z")

</div>

As the title, how to determine the number of tower? which is the parameter numTower in OpenFHE.

---

## [Is there any paper to refer to about threshold FHE?](https://openfhe.discourse.group/t/is-there-any-paper-to-refer-to-about-threshold-fhe/1634)

<div class="topic-metadata">

**Author:** [@leoblue](https://openfhe.discourse.group/u/leoblue)\
**Replies:** 2\
**Last updated:** [October 14, 2024, 2:36am UTC](https://openfhe.discourse.group/t/is-there-any-paper-to-refer-to-about-threshold-fhe/1634 "2024-10-14T02:36:51Z")

</div>

I am using the threshold FHE in my program for multi-party, specifically the threshold BGV. Is there paper about the detailed implementation of how threshold FHE is implemented in openFHE? Thanks for your reply!

[Previous page](https://openfhe.discourse.group/c/fhe-questions/18.md)

[Next page](https://openfhe.discourse.group/c/fhe-questions/18.md?page=2)
