pq-crystals / kyber

Other
833 stars 202 forks source link

Out of bound check in NTT/INTT #71

Closed SherifElewaa closed 8 months ago

SherifElewaa commented 9 months ago

Dear gregorseiler,

In ntt.c source code, there is out-of-boundary check inside ntt and intt functions. For example, in ntt function in line #68 integer j used in the for loop is defined but not initialized:

for(start = 0; start < 256; start = j + len)

As a result, this causes r[j + len] to go out-of-boundary somehow. Could you please comment on this?

Thanks, Sherif

cryptojedi commented 8 months ago

The statement start = j + len is executed at the end of the for-loop body and by that time, the variable j is initialized.

SherifElewaa commented 8 months ago

OK, I see. Thanks!