Supposing that we have a dataset that we want to encrypt using OpenFHE and perform some operations on. In a lower level, OpenFHE will use NTT to perform the dyadic multiplication when needed. Is the NTT configuration always the same for this specific dataset (constant ring size parameter and constant ciphertext modulus parameter throughout an OpenFHE-based application run?), or is it possible that internally the ring size or the ciphertext modulus may change?
In other words, for a given OpenFHE example with a chosen plaintext modulus, the ring size and the ciphertext modulus will automatically be selected by the library to comply with the security standard. The parameters ring-size and ciphertext modulus q=q1q2q3*…, where q1, q2, … are the smaller moduli (up to 60bits) in the RNS representation, will be used in when performing the NTT. So we will have multiple NTTs (of the same ring-size) with different modulus (q1, q2, …) performed. Is there any case, that the ring size or any other parameter affecting the NTT size or functionality will be changed while running the same OpenFHE example?
The question is not clear to me. The ciphertext modulus Q=q_0 \cdot q_1 \ldots \cdot q_{k} which is a product of multiple smaller primes might change depending on the scheme used, the specific choice of some FHE-specific algorithms, and the FHE operations that your application performs. Furthermore, there is an auxiliary ciphertext modulus P=p_0\cdot p_1 \ldots \cdot p_{k'} that is used in certain algorithms, such as key switching.
Once all the moduli q_i's and p_i's are selected for a certain application, they will remain the same throughout the execution of your application. The ring dimension will also remain the same.
If you restart your application, there is a slight chance that the moduli might change q_i's and p_i's due to some introduced randomness. However, the ring dimension is unlikely to change.
Another NTT parameter to note is that for each modulus q_i (or p_i), NTT requires a 2N-th primitive root of unity modulo q_i~(\text{or}~p_i), where N is the ring dimension. These parameters are fixed once generated, but they may change from one run of your application to another.
To provide more specific guidance, I would need to know more about your problem. In the meantime, I hope this clarification is helpful.
ringsize never changes during a session. Some schemes implement ring switching but OpenFHE does not.
as @Cesare says during regular HE of the BGV/BFE/CKKS scheme family, your tower of moduli are fixed, and the number of towers decrease as you consume multiplicative depth. There are other moduli used during hybrid key switching and bootstrapping but they are also fixed at problem generation time.
I was mainly trying to understand why existing NTT hardware accelerators support specific parameters (and if these parameters cover all FHE needs) and whether a fixed size NTT design (e.g. 2^16 NTT) is enough for a given application with selected ring size (e.g. 2^16) or whether OpenFHE performs multiple NTTs of different sizes internally regardless of the selected ring size.
But I think your answers cover that. So, for a given application, only fixed-size NTTs (e.g. 2^16 points NTT) will be performed (based on the selected ring-size).
Yes, that is true, in word-wise FHE schemes such as BFV, BGV and CKKS.
In binary-wise FHE schemes such as DM (a.k.a. FHEW) and CGGI (a.k.a. TFHE), both implemented in OpenFHE, we keep switching between different ring sizes.
That said, the ring size is usually generated by the system initialization to satisfy the requested security, multiplicative depth, mode of operations (PRE, Threshold etc). So it may vary from application to application.
Dave