зеркало из https://github.com/github/putty.git
Since we have bn_restore_invariant, we may as well use it more.
This commit is contained in:
Родитель
19d1ad3887
Коммит
b94a076955
6
sshbn.c
6
sshbn.c
|
@ -1142,8 +1142,7 @@ Bignum bignum_from_bytes(const unsigned char *data, int nbytes)
|
|||
(BignumInt)byte << (8*i % BIGNUM_INT_BITS);
|
||||
}
|
||||
|
||||
while (result[0] > 1 && result[result[0]] == 0)
|
||||
result[0]--;
|
||||
bn_restore_invariant(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1165,8 +1164,7 @@ Bignum bignum_from_bytes_le(const unsigned char *data, int nbytes)
|
|||
(BignumInt)byte << (8*i % BIGNUM_INT_BITS);
|
||||
}
|
||||
|
||||
while (result[0] > 1 && result[result[0]] == 0)
|
||||
result[0]--;
|
||||
bn_restore_invariant(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче