# Reference of EvalCoeffsToSlots function

**URL:** <https://openfhe.discourse.group/t/reference-of-evalcoeffstoslots-function/438>\
**Category:** Library Questions\
**Tags:** questions\
**Created:** [March 28, 2023, 10:10am UTC](https://openfhe.discourse.group/t/reference-of-evalcoeffstoslots-function/438 "2023-03-28T10:10:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xuann6](https://avatars.discourse-cdn.com/v4/letter/x/6f9a4e/32.png) [@xuann6](https://openfhe.discourse.group/u/xuann6)\
**Post date:** [March 28, 2023, 10:10am UTC](https://openfhe.discourse.group/t/reference-of-evalcoeffstoslots-function/438/1 "2023-03-28T10:10:20Z")

</div>

Hi,

I am currently examining the CKKS bootstrapping code, and I am having difficulty understanding the `EvalCoeffsToSlots` function. Based on the code you provided, I understand that if the level budget equals 1, `EvalLinearTransform` is used to compute the result of CoeffToSlot. I am also familiar with the hoisted baby-step giant-step algorithm used in `EvalLinearTransform`.

```auto
ctxtDec = (isLTBootstrap) ? EvalLinearTransform(precom->m_U0Pre, ctxtEnc) :
                            EvalSlotsToCoeffs(precom->m_U0PreFFT, ctxtEnc);

```

However, when I read the description of `EvalCoeffsToSlots`, I was unable to grasp the computational flow of the function. Is there a reference or algorithm you can provide to help me understand it better? Although it appears that `EvalCoeffsToSlots` handles the CoeffToSlot process with different level budgets, I have not yet come across any relevant algorithms.

Additionally, I have noticed that the algorithm used in `EvalLinearTransform` appears to be the double-hoisted automorphism algorithm proposed in “Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-Sparse Keys.” Could you clarify this point for me?

Please let me know if you have any further questions or if I can assist you in any other way.

---

<div class="post-metadata">

**Author:** ![saroja](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@saroja](https://openfhe.discourse.group/u/saroja)\
**Post date:** [April 4, 2023, 4:13pm UTC](https://openfhe.discourse.group/t/reference-of-evalcoeffstoslots-function/438/2 "2023-04-04T16:13:57Z")

</div>

See “Improved Bootstrapping for Approximate  
Homomorphic Encryption” (Chen, Chillotti, Song) [paper](https://eprint.iacr.org/2018/1043.pdf) for a description of the level budget. I am not sure about your other questions.

---

<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:** [April 6, 2023, 3:42pm UTC](https://openfhe.discourse.group/t/reference-of-evalcoeffstoslots-function/438/3 "2023-04-06T15:42:37Z")

</div>

OpenFHE uses double hoisting, similar to what was described in [Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-Sparse Keys](https://eprint.iacr.org/2020/1203). For `EvalCoeffsToSlots`, OpenFHE uses the collapsed FFT approach proposed in [Improved Bootstrapping for Approximate Homomorphic Encryption](https://eprint.iacr.org/2018/1043). The OpenFHE implementation also uses some CKKS enhancements suggested in [Approximate Homomorphic Encryption with Reduced Approximation Error](https://eprint.iacr.org/2020/1118)
