Unit/regression test for TLS heartbeats.
[openssl.git] / doc / crypto / RSA_public_encrypt.pod
index a7b51e99cd8ab1a2dd9bc1433ac7fa6f86ef9ac7..ab0fe3b2cd1c77b81178b56219d9d7e5e3d547de 100644 (file)
@@ -18,7 +18,7 @@ RSA_public_encrypt, RSA_private_decrypt - RSA public key cryptography
 
 RSA_public_encrypt() encrypts the B<flen> bytes at B<from> (usually a
 session key) using the public key B<rsa> and stores the ciphertext in
-B<to>. B<to> must point to B<RSA_size(rsa)> bytes of memory.
+B<to>. B<to> must point to RSA_size(B<rsa>) bytes of memory.
 
 B<padding> denotes one of the following modes:
 
@@ -46,25 +46,26 @@ Encrypting user data directly with RSA is insecure.
 
 =back
 
-B<flen> must be less than RSA_size(rsa) - 11 for the PKCS #1 v1.5
-based padding modes, and less than RSA_size(rsa) - 21 for
-RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded
-prior to calling RSA_public_encrypt().
+B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5
+based padding modes, less than RSA_size(B<rsa>) - 41 for
+RSA_PKCS1_OAEP_PADDING and exactly RSA_size(B<rsa>) for RSA_NO_PADDING.
+The random number generator must be seeded prior to calling
+RSA_public_encrypt().
 
 RSA_private_decrypt() decrypts the B<flen> bytes at B<from> using the
 private key B<rsa> and stores the plaintext in B<to>. B<to> must point
 to a memory section large enough to hold the decrypted data (which is
-smaller than B<RSA_size(rsa)>). B<padding> is the padding mode that
+smaller than RSA_size(B<rsa>)). B<padding> is the padding mode that
 was used to encrypt the data.
 
 =head1 RETURN VALUES
 
 RSA_public_encrypt() returns the size of the encrypted data (i.e.,
-RSA_size(rsa)). RSA_private_decrypt() returns the size of the
+RSA_size(B<rsa>)). RSA_private_decrypt() returns the size of the
 recovered plaintext.
 
 On error, -1 is returned; the error codes can be
-obtained by ERR_get_error(3).
+obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
 
 =head1 CONFORMING TO
 
@@ -72,11 +73,8 @@ SSL, PKCS #1 v2.0
 
 =head1 SEE ALSO
 
-err(3), rand(3), rsa(3), RSA_size(3)
-
-=head1 NOTES
-
-The RSA_PKCS1_RSAref(3) method supports only the RSA_PKCS1_PADDING mode.
+L<ERR_get_error(3)|ERR_get_error(3)>, L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>,
+L<RSA_size(3)|RSA_size(3)>
 
 =head1 HISTORY