From 8ce125f8a8893959021186d99c4bf6d8bba81187 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 28 Aug 2014 02:51:22 +0200 Subject: [PATCH] mp_rand() assumes the number of digits and not the bitsize as parameter --- src/pk/rsa/rsa_exptmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pk/rsa/rsa_exptmod.c b/src/pk/rsa/rsa_exptmod.c index 63fe3e7..5b50367 100644 --- a/src/pk/rsa/rsa_exptmod.c +++ b/src/pk/rsa/rsa_exptmod.c @@ -76,7 +76,7 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen, if (which == PK_PRIVATE) { #ifdef LTC_RSA_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) { goto error; }