mp_rand() assumes the number of digits and not the bitsize as parameter

This commit is contained in:
Steffen Jaeckel 2014-08-28 02:51:22 +02:00
parent f86d36c676
commit 8ce125f8a8

View File

@ -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;
} }