# Understanding Plaintext Implementation

**URL:** <https://openfhe.discourse.group/t/understanding-plaintext-implementation/823>\
**Category:** Library Questions\
**Created:** [September 22, 2023, 7:18pm UTC](https://openfhe.discourse.group/t/understanding-plaintext-implementation/823 "2023-09-22T19:18:00Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [September 22, 2023, 7:18pm UTC](https://openfhe.discourse.group/t/understanding-plaintext-implementation/823/1 "2023-09-22T19:18:00Z")

</div>

Hello!

I’m trying to understand and get deep in OpenFHE implementation of the CKKS scheme, starting with the PlainText. For now I’m a bit overwhelm.

Some questions:

1- I see that there is a encoded vector, an encoded native vector and a DCRT encoded vector. Why we have three? And what are they? The DCRT is clear, the native is before the RNS? and the other?  
2- Is there somewhere that explains in detail how this part of the implementation of encoding in general is done?

Thanks!

---

<div class="post-metadata">

**Author:** ![RDLab](https://avatars.discourse-cdn.com/v4/letter/r/aeb1de/32.png) [@RDLab](https://openfhe.discourse.group/u/RDLab)\
**Post date:** [October 18, 2023, 2:42pm UTC](https://openfhe.discourse.group/t/understanding-plaintext-implementation/823/2 "2023-10-18T14:42:34Z")

</div>

I think it is explained under the heading “Polynomial Representations” at the link below.  
[https://openfhe-development.readthedocs.io/en/latest/sphinx\_rsts/modules/core/lattice/core\_lattice.html#polynomial-representations](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/modules/core/lattice/core_lattice.html#polynomial-representations)

---

<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 18, 2023, 2:52pm UTC](https://openfhe.discourse.group/t/understanding-plaintext-implementation/823/3 "2023-10-18T14:52:09Z")

</div>

Thank you! This is great!

Do you know if in the DCRT first they make the CRT and then for each polynomial they apply NTT? Or if first they make de NTT and then CRT?

---

<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:** [October 18, 2023, 5:28pm UTC](https://openfhe.discourse.group/t/understanding-plaintext-implementation/823/4 "2023-10-18T17:28:12Z")

</div>

First integer CRT (RNS) and then polynomial CRT (NTT). In practice, BGV, BFV, and CKKS already work in the RNS representation (integer CRT and multiprecision arithmetic are used only during precomputations).
