Pārlūkot izejas kodu

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

Steffen Jaeckel 11 gadi atpakaļ
vecāks
revīzija
8ce125f8a8
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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) {
       #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;
       }