summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2004-06-16 13:23:08 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2004-06-16 13:23:08 +0000
commitdac264bc66b2561c9aad4cd88f559ae419f14eab (patch)
treec2d679b094e1960e8330144dbbcf6cf3ca16b872
parent0cf909150e7467dc281e182fb4bb87b8424109c1 (diff)
downloadgnutls-dac264bc66b2561c9aad4cd88f559ae419f14eab.tar.gz
Corrected bug in PKCS #1 encryption.
-rw-r--r--lib/gnutls_pk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c
index 5a2d1e888d..ddfb05798e 100644
--- a/lib/gnutls_pk.c
+++ b/lib/gnutls_pk.c
@@ -115,11 +115,11 @@ int _gnutls_pkcs1_rsa_encrypt(gnutls_datum * 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]);
+ else ps[i] = GMAX( rnd[2] + ps[i-1] + ps[i-2], rnd[1]);
}
}
break;