1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

Fix goof in mp_reduce_mod_2to.

It correctly masked off bits in the partial word, but then left all
higher words _unchanged_ rather than zeroing them.

Apparently its use in mp_invert_mod_2to was in restricted enough
circumstances not to cause a failure there!
This commit is contained in:
Simon Tatham 2019-01-03 10:37:19 +00:00
parent 34d78286e6
commit df1ed3ba6e

View File

@ -1124,7 +1124,7 @@ void mp_reduce_mod_2to(mp_int *x, size_t p)
size_t mask = ((size_t)1 << (p % BIGNUM_INT_BITS)) - 1;
for (; word < x->nw; word++) {
x->w[word] &= mask;
mask = -(size_t)1;
mask = 0;
}
}