quarkslab / NFLlib

NTT-based Fast Lattice library
MIT License
165 stars 52 forks source link

Issue for uint16_t type and n=512 #23

Closed iF2007 closed 6 years ago

iF2007 commented 7 years ago

Hi,

I'm implementing a RLWE key exchange protocol. It seems there is a problem with uint16_t type and n=512 case. For key exchange, k1=(as_2+e_2)s_1+e_1', k2=(as_1+e_1)s_2+e_2'. Theoretically, k1 should approximately equals to k2. a is uniformly random, s_1, s_2, e_1, e_2, e_1', e_2' is sampled from discrete Gaussian distribution with standard deviation 3.2.

My implementation works for n=512 and uint32_t type case, but does not work for uint16_t case. I checked value of k1 and k2, they are not approximately equal in uint16_t case. When I implement with other library using same parameters defined in uint16_t case, it works. I didn't change parameters defined in params.hpp.

Do you have any suggestions where the problem is?

Thanks.

aguinet commented 7 years ago

Do you have any test case that reproduce the issue ? Thanks!

carlosaguilarmelchor commented 6 years ago

Issue closed due to the lack of reply