homenc / HElib

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.
https://homenc.github.io/HElib
Other
3.11k stars 759 forks source link

Arithmetic in integer sub-rings of cyclotomic number fields #505

Open rohitkhera opened 7 months ago

rohitkhera commented 7 months ago

Hello, I am cross posting this to the NTL repo since this it strictly speaking an NTL question.

I wish to do arithmetic on elements contained within an integer subring of a cyclotomic number field commonly used in ring-LWE. As an example, take the cyclotomic field created by adjoining \zeta_8, an 8th root of unity to the rational numbers, i.e., QQ(\zeta_8). This field is isomorphic to the quotient: QQ[X] / <x^4 + 1>. I wish to define elements in an integer subring of this field modulo an odd integer p, i.e., I wish to define elements in ZZ_p[X] / <x^4 + 1>. What is the appropriate class to use for this? I was thinking it may be ZZ_pE. So I tried instantiating this and using the init() method in this class to to set the minimal polynomial for this extension (x^4 + 1). Having done this, I'm not sure about how to define elements in this ring and perform arithmetic on the elements. How is this accomplished in HElib? Any pointers would be appreciated