summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/EVP_EncryptInit.3
diff options
context:
space:
mode:
authorschwarze <>2024-12-20 01:54:03 +0000
committerschwarze <>2024-12-20 01:54:03 +0000
commit0f29c352ca0efe3c3a1facb4e84a69fb6c5bd49f (patch)
treeec0a01cc8ba2795f04119ef34853baa40299213e /src/lib/libcrypto/man/EVP_EncryptInit.3
parentf7a74f625be911c8fc0cafe6e5e0d4d2add39d8e (diff)
downloadopenbsd-0f29c352ca0efe3c3a1facb4e84a69fb6c5bd49f.tar.gz
openbsd-0f29c352ca0efe3c3a1facb4e84a69fb6c5bd49f.tar.bz2
openbsd-0f29c352ca0efe3c3a1facb4e84a69fb6c5bd49f.zip
Move the horrific EVP_aes_128_ccm(3) API out of the important,
algorithm-independent EVP_EncryptInit(3) manual as another step in making the latter leaner and more palatable. As a side benefit, the new EVP_aes_128_ccm(3) manual page may provide a better fighting chance to programmers who see themselves forced to support CCM for whatever reason. It documents the mandatory, but so far undocumented EVP_CTRL_CCM_GET_TAG control command and makes the description of the three EVP_CTRL_CCM_SET_* control commands and the numerous related quirks more precise.
Diffstat (limited to 'src/lib/libcrypto/man/EVP_EncryptInit.3')
-rw-r--r--src/lib/libcrypto/man/EVP_EncryptInit.354
1 files changed, 4 insertions, 50 deletions
diff --git a/src/lib/libcrypto/man/EVP_EncryptInit.3 b/src/lib/libcrypto/man/EVP_EncryptInit.3
index 8f977b7a2a..7765be2ca6 100644
--- a/src/lib/libcrypto/man/EVP_EncryptInit.3
+++ b/src/lib/libcrypto/man/EVP_EncryptInit.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_EncryptInit.3,v 1.55 2024/12/17 18:11:44 schwarze Exp $ 1.\" $OpenBSD: EVP_EncryptInit.3,v 1.56 2024/12/20 01:54:03 schwarze Exp $
2.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800 2.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800
3.\" EVP_bf_cbc.pod EVP_cast5_cbc.pod EVP_idea_cbc.pod EVP_rc2_cbc.pod 3.\" EVP_bf_cbc.pod EVP_cast5_cbc.pod EVP_idea_cbc.pod EVP_rc2_cbc.pod
4.\" 7c6d372a Nov 20 13:20:01 2018 +0000 4.\" 7c6d372a Nov 20 13:20:01 2018 +0000
@@ -69,7 +69,7 @@
69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70.\" OF THE POSSIBILITY OF SUCH DAMAGE. 70.\" OF THE POSSIBILITY OF SUCH DAMAGE.
71.\" 71.\"
72.Dd $Mdocdate: December 17 2024 $ 72.Dd $Mdocdate: December 20 2024 $
73.Dt EVP_ENCRYPTINIT 3 73.Dt EVP_ENCRYPTINIT 3
74.Os 74.Os
75.Sh NAME 75.Sh NAME
@@ -600,6 +600,7 @@ Some algorithms are documented in separate manual pages:
600.Bl -column "EVP_camellia_128_cbc(3)" "block size" -compact 600.Bl -column "EVP_camellia_128_cbc(3)" "block size" -compact
601.It manual page Ta block size Ta Fa key No size Pq in bits 601.It manual page Ta block size Ta Fa key No size Pq in bits
602.It Xr EVP_aes_128_cbc 3 Ta 128 Ta 128, 192, 256 602.It Xr EVP_aes_128_cbc 3 Ta 128 Ta 128, 192, 256
603.It Xr EVP_aes_128_ccm 3 Ta 128 Ta 128, 192, 256
603.It Xr EVP_aes_128_gcm 3 Ta 128 Ta 128, 192, 256 604.It Xr EVP_aes_128_gcm 3 Ta 128 Ta 128, 192, 256
604.It Xr EVP_camellia_128_cbc 3 Ta 128 Ta 128, 192, 256 605.It Xr EVP_camellia_128_cbc 3 Ta 128 Ta 128, 192, 256
605.It Xr EVP_chacha20 3 Ta stream Ta 256 606.It Xr EVP_chacha20 3 Ta stream Ta 256
@@ -608,54 +609,6 @@ Some algorithms are documented in separate manual pages:
608.It Xr EVP_rc4 3 Ta stream Ta variable, default 128 609.It Xr EVP_rc4 3 Ta stream Ta variable, default 128
609.It Xr EVP_sm4_cbc 3 Ta 128 Ta 128 610.It Xr EVP_sm4_cbc 3 Ta 128 Ta 128
610.El 611.El
611.Ss CCM mode
612The behaviour of CCM mode ciphers is similar to GCM mode, but with
613a few additional requirements and different ctrl values.
614.Pp
615Like GCM mode any additional authenticated data (AAD) is passed
616by calling
617.Fn EVP_CipherUpdate ,
618.Fn EVP_EncryptUpdate ,
619or
620.Fn EVP_DecryptUpdate
621with the output parameter
622.Fa out
623set to
624.Dv NULL .
625Additionally, the total
626plaintext or ciphertext length MUST be passed to
627.Fn EVP_CipherUpdate ,
628.Fn EVP_EncryptUpdate ,
629or
630.Fn EVP_DecryptUpdate
631with the output and input
632parameters
633.Pq Fa in No and Fa out
634set to
635.Dv NULL
636and the length passed in the
637.Fa in_len
638parameter.
639.Pp
640The following ctrls are supported in CCM mode:
641.Bl -tag -width Ds
642.It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_CCM_SET_TAG taglen tag
643This call is made to set the expected CCM tag value when decrypting or
644the length of the tag (with the
645.Fa tag
646parameter set to
647.Dv NULL )
648when encrypting.
649The tag length is often referred to as M.
650If not set, a default value is used (12 for AES).
651.It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_CCM_SET_L ivlen NULL
652Sets the CCM L value.
653If not set, a default is used (8 for AES).
654.It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_CCM_SET_IVLEN ivlen NULL
655Sets the CCM nonce (IV) length: this call can only be made before
656specifying a nonce value.
657The nonce length is given by 15 - L so it is 7 by default for AES.
658.El
659.Sh EXAMPLES 612.Sh EXAMPLES
660Encrypt a string using blowfish: 613Encrypt a string using blowfish:
661.Bd -literal -offset 3n 614.Bd -literal -offset 3n
@@ -770,6 +723,7 @@ do_crypt(FILE *in_fileptr, FILE *out_fileptr, int do_encrypt)
770.Xr evp 3 , 723.Xr evp 3 ,
771.Xr EVP_AEAD_CTX_init 3 , 724.Xr EVP_AEAD_CTX_init 3 ,
772.Xr EVP_aes_128_cbc 3 , 725.Xr EVP_aes_128_cbc 3 ,
726.Xr EVP_aes_128_ccm 3 ,
773.Xr EVP_aes_128_gcm 3 , 727.Xr EVP_aes_128_gcm 3 ,
774.Xr EVP_camellia_128_cbc 3 , 728.Xr EVP_camellia_128_cbc 3 ,
775.Xr EVP_chacha20 3 , 729.Xr EVP_chacha20 3 ,