]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Corrected bug in PKCS #1 encryption.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 16 Jun 2004 13:22:38 +0000 (13:22 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 16 Jun 2004 13:22:38 +0000 (13:22 +0000)
lib/gnutls_pk.c

index ad59220a38be97fa61738bfc7fe7edb415e36ace..6361ba8d92a824f2b983adb8ba37aea7273d5a35 100644 (file)
@@ -123,13 +123,13 @@ int _gnutls_pkcs1_rsa_encrypt(gnutls_datum_t * ciphertext,
            if (ps[i] == 0) {
                /* If the first one is zero then set it to rnd[0].
                 * If the second one is zero then set it to rnd[1].
-                * Otherwise add (mod 256) the two previous ones plus rnd[3], or use
+                * Otherwise add (mod 256) the two previous ones plus rnd[2], or use
                 * rnd[1] if the value == 0.
                 */
                if (i < 2)
                    ps[i] = rnd[i];
                else
-                   ps[i] = GMAX(rnd[3] + ps[i - 1] + ps[i - 2], rnd[1]);
+                   ps[i] = GMAX(rnd[2] + ps[i - 1] + ps[i - 2], rnd[1]);
            }
        }
        break;