Maximum number of slots

Hi all,
What is the maximum number of elements a CKKS Plaintext can contain in general and in OpenFHE ?
Does it depend only on the security model?

Thanks

It strictly depends on N, in particular the maximum number of elements is equal to N/2.

AFAIK the space is halved because of the default encoding process of CKKS (i.e. Slots encoding), performed in order to make the polynomial multiplication in the ciphertext space reflected as a point-wise multiplication in the plaintext space (and thus, to enable SIMD computations).

But can we set N to 2^32 or 2^64 for example ? How much it will impact the performances ?

I do not think it is feasible. N=2^{17} is already a very large value. In your case I would split my data in multiple ciphertexts.

Note in the Conjugate-Invariant CKKS, you can encrypt up to N real numbers.

1 Like

This is an enormous ring dimension. As @narger mentioned, I would not go beyond N=2^{17} on general-purpose CPU implementations.

The limits imposed by ultra-large ring dimensions are mostly computational in terms of runtime and space. Security should not be an issue.

@sofianeazgh When you need a larger number of slots, you can simply use multiple plaintexts, i.e., encode the large vector into a vector of plaintexts, each with N/2 elements.

Thank you guys for the answers.
The multi-vector split method appears to be the most intuitive. However, are you familiar with any methods for matrix multiplication when dealing with large vectors that are split into multiple “sub-vectors”?

Check this thread, it claims an implementation of matrix multiplication in OpenFHE. Not sure if it supports multiple ciphertexts though.