-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Description
A part of code to calculate pending elements(<256) of matrix in poly_uniform in the reference implementation is unreachable as 'buflen' is a multiple of 3(STREAM128_BLOCKBYTES=168) which makes 'off' always zero and the 'for' loop never executes.
Unreachable code:
while(ctr < N) {
off = buflen % 3;
for(i = 0; i < off; ++i)
buf[i] = buf[buflen - off + i];
stream128_squeezeblocks(buf + off, 1, &state);
buflen = STREAM128_BLOCKBYTES + off;
ctr += rej_uniform(a->coeffs + ctr, N - ctr, buf, buflen);
}
Possible Fix:
while(ctr < N) {
stream128_squeezeblocks(buf, 1, &state);
ctr += rej_uniform(a->coeffs + ctr, N - ctr, buf, STREAM128_BLOCKBYTES);
}
Metadata
Metadata
Assignees
Labels
No labels