HElib is an open-source software library that implements homomorphic encryption. It supports the BGV scheme with bootstrapping and the Approximate Number CKKS scheme. HElib also includes optimizations for efficient homomorphic evaluation, focusing on effective use of ciphertext packing techniques and on the Gentry-Halevi-Smart optimizations.
Could not parse params file: '~/bgv2.txt'. Not a valid value '[16383,3]'
I suspect this error is triggered because mvec has length equal to one, while gens has length equal to two. Nonetheless, these parameters seem correct. Specifically, the quotient field Z^*_m/(p) actually has two generators (because m is a power of two), yet mvec cannot contain more than one value, because its only devisor is two. This means gens should be bigger than mvec in this case.
One way to go around this is to set p so that Z^*_m/(p) has exactly one generator. However, that generator will have to be -1 (i.e. the "other" generator of Z^*_m). This means that Z^*_m/(p) = Z_2 and thus |Z^*_m/(p)|=2, meaning we have only two plaintext slots to work with. I would like to work with more than two slots.
What is the right way of getting a BGV context with m a power of two?
Running the following within
utils/bin
:where
~/bgv.txt
contains:gives an error:
I suspect this error is triggered because
mvec
has length equal to one, whilegens
has length equal to two. Nonetheless, these parameters seem correct. Specifically, the quotient field Z^*_m/(p) actually has two generators (because m is a power of two), yetmvec
cannot contain more than one value, because its only devisor is two. This meansgens
should be bigger thanmvec
in this case.One way to go around this is to set
p
so that Z^*_m/(p) has exactly one generator. However, that generator will have to be -1 (i.e. the "other" generator of Z^*_m). This means that Z^*_m/(p) = Z_2 and thus |Z^*_m/(p)|=2, meaning we have only two plaintext slots to work with. I would like to work with more than two slots.What is the right way of getting a BGV context with
m
a power of two?