# Format switching in CKKS

**URL:** <https://openfhe.discourse.group/t/format-switching-in-ckks/851>\
**Category:** Library Questions\
**Created:** [October 20, 2023, 10:05am UTC](https://openfhe.discourse.group/t/format-switching-in-ckks/851 "2023-10-20T10:05:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jomivaan](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jomivaan](https://openfhe.discourse.group/u/jomivaan)\
**Post date:** [October 20, 2023, 10:05am UTC](https://openfhe.discourse.group/t/format-switching-in-ckks/851/1 "2023-10-20T10:05:18Z")

</div>

Hello, I am trying to understand how and why we change from COEFF to EVAL format and vice-versa. Is there any paper basis explaining it?  
Thank you

---

<div class="post-metadata">

**Author:** ![mmazz](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@mmazz](https://openfhe.discourse.group/u/mmazz)\
**Post date:** [October 20, 2023, 1:23pm UTC](https://openfhe.discourse.group/t/format-switching-in-ckks/851/2 "2023-10-20T13:23:00Z")

</div>

Hello,  
Its to speed up the polynomial multiplications. In COEFF space you have a complexity O(N^2) and in EVAL a complexity O(nlogn).

In can’t think of a paper, but here is a blog that has a good explanation for something similar (digital signature) ([link](https://electricdusk.com/ntt.html)).  
Or may be a paper that explains the implementation: A note on the implementation of the Number  
Theoretic Transform - Michael Scott ([link](https://eprint.iacr.org/2017/727.pdf))

You can see there that the way to change from COEFF to EVAL is using Number Theoretic Transform (NTT), and then from EVAL to COEFF is using the inverse of this INTT. Basically is a Fourier transform for finite fields.

---

<div class="post-metadata">

**Author:** ![jomivaan](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jomivaan](https://openfhe.discourse.group/u/jomivaan)\
**Post date:** [October 20, 2023, 5:56pm UTC](https://openfhe.discourse.group/t/format-switching-in-ckks/851/3 "2023-10-20T17:56:17Z")

</div>

Hello,  
Thank you for the help!
