# Easy way to evaluate N/2 polynomials over N/2 slots

**URL:** <https://openfhe.discourse.group/t/easy-way-to-evaluate-n-2-polynomials-over-n-2-slots/2194>\
**Category:** Library Questions\
**Created:** [October 16, 2025, 9:50am UTC](https://openfhe.discourse.group/t/easy-way-to-evaluate-n-2-polynomials-over-n-2-slots/2194 "2025-10-16T09:50:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![narger](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/narger/32/420_2.png) [@narger](https://openfhe.discourse.group/u/narger)\
**Post date:** [October 16, 2025, 9:50am UTC](https://openfhe.discourse.group/t/easy-way-to-evaluate-n-2-polynomials-over-n-2-slots/2194/1 "2025-10-16T09:50:13Z")

</div>

Hi everyone 🙂

I have a quick question: in CKKS we can evaluate a polynomial by a set of coefficients on the whole slots of a ciphertext. Does OpenFHE allow for the SIMD evaluation of n/2 polynomials (of same degree), one for each slot? I guess theoretically it should be possible, but I don’t know if it is maybe already implemented as a subroutine somewhere or it should be written by scratch (I guess by replacing constants with plaintexts in evalpoly functions).

Thanks!

---

<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:** [October 16, 2025, 5:30pm UTC](https://openfhe.discourse.group/t/easy-way-to-evaluate-n-2-polynomials-over-n-2-slots/2194/2 "2025-10-16T17:30:13Z")

</div>

No, this is not implemented. And you are correct that the way to do it is to change the current implementation from scalar x vector to vector x vector, by packing the different coefficients corresponding to a power in a plaintext. Note that despite the conceptually simple changes, the implementation changes might be extensive. For one, it might be better to preprocess all the recursive long divisions done in the Paterson-Stockmeyer algorithm for the n/2 polynomials. Moreover, although the degrees of the n/2 polynomials is the same, the coefficients are different across polynomials and you won’t be able to take advantage by multiplications by zeros or ones in the coefficients.

---

<div class="post-metadata">

**Author:** ![narger](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/narger/32/420_2.png) [@narger](https://openfhe.discourse.group/u/narger)\
**Post date:** [November 5, 2025, 6:10pm UTC](https://openfhe.discourse.group/t/easy-way-to-evaluate-n-2-polynomials-over-n-2-slots/2194/3 "2025-11-05T18:10:29Z")

</div>

when you say

> you won’t be able to take advantage by multiplications by zeros or ones in the coefficients.

you mean that the current PS algorithm, when it has to evaluate c \cdot X^k:

- Does not add anything if c = 0
- Simply adds X^k if c=1
- Perform the actual multiplication otherwise

Correct? Or you mean something more sophisticated? Thanks!

---

<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:** [November 5, 2025, 11:13pm UTC](https://openfhe.discourse.group/t/easy-way-to-evaluate-n-2-polynomials-over-n-2-slots/2194/4 "2025-11-05T23:13:45Z")

</div>

Yes. When you have a vector of constants, some of them might be 0 or 1 but not all, and you will use a Hadamard product.
