Explorar o código

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

Steffen Jaeckel %!s(int64=11) %!d(string=hai) anos
pai
achega
8ce125f8a8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/pk/rsa/rsa_exptmod.c

+ 1 - 1
src/pk/rsa/rsa_exptmod.c

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