зеркало из https://github.com/github/putty.git
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:
Родитель
34d78286e6
Коммит
df1ed3ba6e
2
mpint.c
2
mpint.c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче