From: Nikos Mavrogiannopoulos Date: Wed, 16 Jun 2004 13:22:38 +0000 (+0000) Subject: Corrected bug in PKCS #1 encryption. X-Git-Tag: gnutls_1_1_11~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=205a59b2ade1ae1cd227aeb0602265e2e6cca07a;p=thirdparty%2Fgnutls.git Corrected bug in PKCS #1 encryption. --- diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c index ad59220a38..6361ba8d92 100644 --- a/lib/gnutls_pk.c +++ b/lib/gnutls_pk.c @@ -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;