Closed JoFLV closed 7 years ago
A single ciphertext has a set number of "slots", depending on the specific parameters (specifically the m
and p
parameters). So in this sense, once you fixed these parameters you cannot modify the array size.
You can always concatenate two cipehrtexts to get an array of twice the size, you will have to write the logic yourself to treat these two ciphertexts as a single array (i.e., apply the same operations to these ciphertexts, decrypt them together, etc.)
Thanks for your fast reply. Is there a formula to calculate m for a given fixed p and a given fixed plaintextarraylength ?
Thanks and Regards
Unfortunately, no such formula. Given m and p it is easy to compute the number of slots, but essentially the only way to find good m is to try many of them until you find one that's appropriate. Choosing parameters for FHE is currently somewhat of a black art, this area can certainly use more research.
Choosing parameters seems to be still complex. I agree this area can use more research.
You mentioned it is easy to compute the number of slots for given m and p - how does it work ? Is there a code snippet in the project ?
Thanks for your support
You mentioned it is easy to compute the number of slots for given m and p - how does it work?
You need to find the order of p in the multiplicative group $Z_m^*$ (namely the smallest integer e such that p^e=1 mod m). Once you found that number e, the number of slots is phi(m)/e. One (very wasteful) way of doing it with HElib is
PAlgebra pa(m,p);
cout << pa.getNSlots();
Thanks for your help
Hi all,
i am playing around with the HElib project. I wanted to know if it is easily possible to generate random plaintextarrays with different array lengths. My goal is to check if there are runtime differences in using different plaintext lengths. Even after looking deeper in the code i could not find a suitable solution.
Thanks in advance JoFLV