NTRU: fix false positives caused by &array <=> array
The cast (unsigned char *) cast of &[poly].coeffs creates a confusion about whether the coefficients or the array base address are being modified by the subsequent cmov call (it should be the coefficients). Change this by taking into account the indirection level after casts, i.e. (unsigned char *) should have indirection level 1, regardless of the indirection level of . Also, provide tests.
The issue is actually caused by the expression &array
. It refers to the base address of that array, and thus, for our analysis, has the same indirection as plain array
. Therefore, &array
should not increase the indirection of array
(in a similar fashion as &fct_ptr
and fct_ptr
are essentially the same thing).