mp_rand() assumes the number of digits and not the bitsize as parameter
This commit is contained in:
parent
f86d36c676
commit
8ce125f8a8
@ -76,7 +76,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen,
|
|||||||
if (which == PK_PRIVATE) {
|
if (which == PK_PRIVATE) {
|
||||||
#ifdef LTC_RSA_BLINDING
|
#ifdef LTC_RSA_BLINDING
|
||||||
/* do blinding */
|
/* do blinding */
|
||||||
err = mp_rand(rnd, mp_count_bits(key->N));
|
err = mp_rand(rnd, mp_get_digit_count(key->N));
|
||||||
if (err != CRYPT_OK) {
|
if (err != CRYPT_OK) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user