microsoft/PQCrypto-SIDH

Undefined left shift by -1 in ord2w_dloghyb

jschanck opened this issue · 1 comments

It is possible for the following line to be executed with ord=1, in which case the left shift is undefined.

if (i_j >= (1 << (ord-2))) {

It would be OK to multiply through by 2 or 4 here, there's no risk of overflow.

Thanks for reporting this issue, John. A related variable wasn't properly corrected to the range [0, p-1] before being tested against 0. I pushed a fix.