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.
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.