vernamlab / DHS-LTV

The library provides a homomorphic encryption scheme by Doroz, Hu and Sunar, along with various applications. The scheme is a variant of Lopez-Alt, Tromer and Vaikuntanathan Homomorphic Encryption.
MIT License
7 stars 4 forks source link

Func_ComputeKeysRingRelinFFT problem #3

Open Jyun-Neng opened 6 years ago

Jyun-Neng commented 6 years ago

At line 424 in ltv.cpp file (src folder), f = ftp + 1. Not all coefficients in f are assigned ft[i]p+1. In fact, only f[0] is ft[0]p+1. Others, for example, f[1] is ft[1]p.

yarkindoroz commented 6 years ago

It is the correct use case. The logic is that a key f with property f =2f'+1 is used to extract message after multiplications and mod 2 operation. For instance; f*m = 2f'm + m, if we take mod 2 we have m as result. If all the elements have +1, we will not be able to have m. We will have m distributed to all the slots as m+mx+mx^2+mx^3 ... . This will mess up the computation algorithmically.

Jyun-Neng commented 6 years ago

Thank you! I understand!