I’ve recently been reading the source code of TFHE and OpenFHE, but I have many questions regarding the construction of test polynomials, especially since OpenFHE’s implementation differs significantly from TFHE’s. I would appreciate the opportunity to discuss this with others.
TFHE refers to TFHE Fast Fully Homomorphic Encryption over the Torus
The OpenFHE implementation below is based on the file boolean .
- First in TFHE, before bootstrapping we use ModulusSwitch change the q to 2N, but openfhe not and openfhe embeds the ring Z_Q[X]/(X^{q/2} + 1) into Z_Q[X]/(X^N + 1). Why openfhe use sparse embedding? Why not use the TFHE method, spare embedding has any advantages?
- Second in TFHE, testvector can be initialized easily such as X^{2N-b}[\frac{q}{8},...,\frac{q}{8}], but openfhe set more complex like m(X)=\sum_{i<q/2}f(v-i)\cdot X^i. These two forms of expression do not appear to be mathematically equivalent. OpenFHE, on the other hand, only occupies half the space of m[X] (when N=q=1024).
- Third, in OpenFHE, I didn’t see any explicit use of the
SampleExtractfunction; I only saw the transposition ofa. However,SampleExtractis not so trivial in TFHE. Is this because OpenFHE uses a special mapping method? - Fourth, I also found significant differences between TFHE and OpenFHE in terms of parameter size. For example, in TFHE, q should be set bigger like 2^{32}, however in openfhe it can be set smaller like 1024.
I have roughly read this paper: Bootstrapping in FHEW-like Cryptosystems, but I don’t fully understand some of the tricks it uses, especially how it uses different construction methods but the results are equivalent to TFHE.