diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/EVP_EncryptInit.3 | 58 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/EVP_aes_128_cbc.3 | 25 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/EVP_aes_128_gcm.3 | 249 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 |
4 files changed, 260 insertions, 75 deletions
diff --git a/src/lib/libcrypto/man/EVP_EncryptInit.3 b/src/lib/libcrypto/man/EVP_EncryptInit.3 index 3e0cec8f9e..8f977b7a2a 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.54 2024/12/08 17:41:23 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_EncryptInit.3,v 1.55 2024/12/17 18:11:44 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 8 2024 $ | 72 | .Dd $Mdocdate: December 17 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_gcm 3 Ta 128 Ta 128, 192, 256 | ||
| 603 | .It Xr EVP_camellia_128_cbc 3 Ta 128 Ta 128, 192, 256 | 604 | .It Xr EVP_camellia_128_cbc 3 Ta 128 Ta 128, 192, 256 |
| 604 | .It Xr EVP_chacha20 3 Ta stream Ta 256 | 605 | .It Xr EVP_chacha20 3 Ta stream Ta 256 |
| 605 | .It Xr EVP_des_cbc 3 Ta 64 Ta 64 | 606 | .It Xr EVP_des_cbc 3 Ta 64 Ta 64 |
| @@ -607,58 +608,6 @@ Some algorithms are documented in separate manual pages: | |||
| 607 | .It Xr EVP_rc4 3 Ta stream Ta variable, default 128 | 608 | .It Xr EVP_rc4 3 Ta stream Ta variable, default 128 |
| 608 | .It Xr EVP_sm4_cbc 3 Ta 128 Ta 128 | 609 | .It Xr EVP_sm4_cbc 3 Ta 128 Ta 128 |
| 609 | .El | 610 | .El |
| 610 | .Ss GCM mode | ||
| 611 | For GCM mode ciphers, the behaviour of the EVP interface | ||
| 612 | is subtly altered and several additional ctrl operations are | ||
| 613 | supported. | ||
| 614 | .Pp | ||
| 615 | To specify any additional authenticated data (AAD), a call to | ||
| 616 | .Fn EVP_CipherUpdate , | ||
| 617 | .Fn EVP_EncryptUpdate , | ||
| 618 | or | ||
| 619 | .Fn EVP_DecryptUpdate | ||
| 620 | should be made with the output parameter | ||
| 621 | .Fa out | ||
| 622 | set to | ||
| 623 | .Dv NULL . | ||
| 624 | .Pp | ||
| 625 | When decrypting, the return value of | ||
| 626 | .Fn EVP_DecryptFinal , | ||
| 627 | .Fn EVP_DecryptFinal_ex , | ||
| 628 | .Fn EVP_CipherFinal , | ||
| 629 | or | ||
| 630 | .Fn EVP_CipherFinal_ex | ||
| 631 | indicates if the operation was successful. | ||
| 632 | If it does not indicate success, the authentication operation has | ||
| 633 | failed and any output data MUST NOT be used as it is corrupted. | ||
| 634 | .Pp | ||
| 635 | The following ctrls are supported in GCM mode: | ||
| 636 | .Bl -tag -width Ds | ||
| 637 | .It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_GCM_SET_IVLEN ivlen NULL | ||
| 638 | Sets the IV length: this call can only be made before specifying an IV. | ||
| 639 | If not called, a default IV length is used. | ||
| 640 | For GCM AES the default is 12, i.e. 96 bits. | ||
| 641 | .It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_GCM_GET_TAG taglen tag | ||
| 642 | Writes | ||
| 643 | .Fa taglen | ||
| 644 | bytes of the tag value to the buffer indicated by | ||
| 645 | .Fa tag . | ||
| 646 | This call can only be made when encrypting data and after all data has | ||
| 647 | been processed, e.g. after an | ||
| 648 | .Fn EVP_EncryptFinal | ||
| 649 | or | ||
| 650 | .Fn EVP_EncryptFinal_ex | ||
| 651 | call. | ||
| 652 | .It Fn EVP_CIPHER_CTX_ctrl ctx EVP_CTRL_GCM_SET_TAG taglen tag | ||
| 653 | Sets the expected tag to | ||
| 654 | .Fa taglen | ||
| 655 | bytes from | ||
| 656 | .Fa tag . | ||
| 657 | This call is only legal when decrypting data and must be made before | ||
| 658 | any data is processed, e.g. before any | ||
| 659 | .Fa EVP_DecryptUpdate | ||
| 660 | call. | ||
| 661 | .El | ||
| 662 | .Ss CCM mode | 611 | .Ss CCM mode |
| 663 | The behaviour of CCM mode ciphers is similar to GCM mode, but with | 612 | The behaviour of CCM mode ciphers is similar to GCM mode, but with |
| 664 | a few additional requirements and different ctrl values. | 613 | a few additional requirements and different ctrl values. |
| @@ -821,6 +770,7 @@ do_crypt(FILE *in_fileptr, FILE *out_fileptr, int do_encrypt) | |||
| 821 | .Xr evp 3 , | 770 | .Xr evp 3 , |
| 822 | .Xr EVP_AEAD_CTX_init 3 , | 771 | .Xr EVP_AEAD_CTX_init 3 , |
| 823 | .Xr EVP_aes_128_cbc 3 , | 772 | .Xr EVP_aes_128_cbc 3 , |
| 773 | .Xr EVP_aes_128_gcm 3 , | ||
| 824 | .Xr EVP_camellia_128_cbc 3 , | 774 | .Xr EVP_camellia_128_cbc 3 , |
| 825 | .Xr EVP_chacha20 3 , | 775 | .Xr EVP_chacha20 3 , |
| 826 | .Xr EVP_CIPHER_CTX_ctrl 3 , | 776 | .Xr EVP_CIPHER_CTX_ctrl 3 , |
diff --git a/src/lib/libcrypto/man/EVP_aes_128_cbc.3 b/src/lib/libcrypto/man/EVP_aes_128_cbc.3 index 6249bf7348..cbb68e1543 100644 --- a/src/lib/libcrypto/man/EVP_aes_128_cbc.3 +++ b/src/lib/libcrypto/man/EVP_aes_128_cbc.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: EVP_aes_128_cbc.3,v 1.6 2024/11/09 22:03:49 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_aes_128_cbc.3,v 1.7 2024/12/17 18:11:44 schwarze Exp $ |
| 2 | .\" selective merge up to: OpenSSL 7c6d372a Nov 20 13:20:01 2018 +0000 | 2 | .\" selective merge up to: OpenSSL 7c6d372a Nov 20 13:20:01 2018 +0000 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ronald Tse <ronald.tse@ribose.com> | 4 | .\" This file was written by Ronald Tse <ronald.tse@ribose.com> |
| @@ -48,7 +48,7 @@ | |||
| 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 50 | .\" | 50 | .\" |
| 51 | .Dd $Mdocdate: November 9 2024 $ | 51 | .Dd $Mdocdate: December 17 2024 $ |
| 52 | .Dt EVP_AES_128_CBC 3 | 52 | .Dt EVP_AES_128_CBC 3 |
| 53 | .Os | 53 | .Os |
| 54 | .Sh NAME | 54 | .Sh NAME |
| @@ -81,9 +81,6 @@ | |||
| 81 | .Nm EVP_aes_128_ccm , | 81 | .Nm EVP_aes_128_ccm , |
| 82 | .Nm EVP_aes_192_ccm , | 82 | .Nm EVP_aes_192_ccm , |
| 83 | .Nm EVP_aes_256_ccm , | 83 | .Nm EVP_aes_256_ccm , |
| 84 | .Nm EVP_aes_128_gcm , | ||
| 85 | .Nm EVP_aes_192_gcm , | ||
| 86 | .Nm EVP_aes_256_gcm , | ||
| 87 | .Nm EVP_aes_128_wrap , | 84 | .Nm EVP_aes_128_wrap , |
| 88 | .Nm EVP_aes_192_wrap , | 85 | .Nm EVP_aes_192_wrap , |
| 89 | .Nm EVP_aes_256_wrap , | 86 | .Nm EVP_aes_256_wrap , |
| @@ -151,12 +148,6 @@ | |||
| 151 | .Ft const EVP_CIPHER * | 148 | .Ft const EVP_CIPHER * |
| 152 | .Fn EVP_aes_256_ccm void | 149 | .Fn EVP_aes_256_ccm void |
| 153 | .Ft const EVP_CIPHER * | 150 | .Ft const EVP_CIPHER * |
| 154 | .Fn EVP_aes_128_gcm void | ||
| 155 | .Ft const EVP_CIPHER * | ||
| 156 | .Fn EVP_aes_192_gcm void | ||
| 157 | .Ft const EVP_CIPHER * | ||
| 158 | .Fn EVP_aes_256_gcm void | ||
| 159 | .Ft const EVP_CIPHER * | ||
| 160 | .Fn EVP_aes_128_wrap void | 151 | .Fn EVP_aes_128_wrap void |
| 161 | .Ft const EVP_CIPHER * | 152 | .Ft const EVP_CIPHER * |
| 162 | .Fn EVP_aes_192_wrap void | 153 | .Fn EVP_aes_192_wrap void |
| @@ -222,13 +213,9 @@ These ciphers do not conform to the EVP AEAD interface. | |||
| 222 | .Pp | 213 | .Pp |
| 223 | .Fn EVP_aes_128_ccm , | 214 | .Fn EVP_aes_128_ccm , |
| 224 | .Fn EVP_aes_192_ccm , | 215 | .Fn EVP_aes_192_ccm , |
| 225 | .Fn EVP_aes_256_ccm , | ||
| 226 | .Fn EVP_aes_128_gcm , | ||
| 227 | .Fn EVP_aes_192_gcm , | ||
| 228 | and | 216 | and |
| 229 | .Fn EVP_aes_256_gcm | 217 | .Fn EVP_aes_256_ccm |
| 230 | provide AES for 128, 192 and 256-bit keys in CBC-MAC Mode (CCM) | 218 | provide AES for 128, 192 and 256-bit keys in CBC-MAC Mode (CCM), respectively. |
| 231 | and Galois Counter Mode (GCM), respectively. | ||
| 232 | These ciphers require additional control operations to function | 219 | These ciphers require additional control operations to function |
| 233 | correctly; see | 220 | correctly; see |
| 234 | .Xr EVP_EncryptInit 3 | 221 | .Xr EVP_EncryptInit 3 |
| @@ -284,6 +271,7 @@ structure that provides the implementation of the symmetric cipher. | |||
| 284 | .Sh SEE ALSO | 271 | .Sh SEE ALSO |
| 285 | .Xr AES_encrypt 3 , | 272 | .Xr AES_encrypt 3 , |
| 286 | .Xr evp 3 , | 273 | .Xr evp 3 , |
| 274 | .Xr EVP_aes_128_gcm 3 , | ||
| 287 | .Xr EVP_EncryptInit 3 | 275 | .Xr EVP_EncryptInit 3 |
| 288 | .Sh HISTORY | 276 | .Sh HISTORY |
| 289 | .Fn EVP_aes_128_cbc , | 277 | .Fn EVP_aes_128_cbc , |
| @@ -323,9 +311,6 @@ first appeared in OpenSSL 0.9.7e and have been available since | |||
| 323 | .Fn EVP_aes_128_ccm , | 311 | .Fn EVP_aes_128_ccm , |
| 324 | .Fn EVP_aes_192_ccm , | 312 | .Fn EVP_aes_192_ccm , |
| 325 | .Fn EVP_aes_256_ccm , | 313 | .Fn EVP_aes_256_ccm , |
| 326 | .Fn EVP_aes_128_gcm , | ||
| 327 | .Fn EVP_aes_192_gcm , | ||
| 328 | .Fn EVP_aes_256_gcm , | ||
| 329 | .Fn EVP_aes_128_xts , | 314 | .Fn EVP_aes_128_xts , |
| 330 | and | 315 | and |
| 331 | .Fn EVP_aes_256_xts | 316 | .Fn EVP_aes_256_xts |
diff --git a/src/lib/libcrypto/man/EVP_aes_128_gcm.3 b/src/lib/libcrypto/man/EVP_aes_128_gcm.3 new file mode 100644 index 0000000000..1e15cb79aa --- /dev/null +++ b/src/lib/libcrypto/man/EVP_aes_128_gcm.3 | |||
| @@ -0,0 +1,249 @@ | |||
| 1 | .\" $OpenBSD: EVP_aes_128_gcm.3,v 1.1 2024/12/17 18:11:44 schwarze Exp $ | ||
| 2 | .\" full merge up to: | ||
| 3 | .\" OpenSSL EVP_EncryptInit.pod 0874d7f2 Oct 11 13:13:47 2022 +0100 | ||
| 4 | .\" OpenSSL EVP_aes.pod a1ec85c1 Apr 21 10:49:12 2020 +0100 | ||
| 5 | .\" | ||
| 6 | .\" Copyright (c) 2024 Ingo Schwarze <schwarze@openbsd.org> | ||
| 7 | .\" | ||
| 8 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 9 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 10 | .\" copyright notice and this permission notice appear in all copies. | ||
| 11 | .\" | ||
| 12 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 13 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 14 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 15 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 16 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 17 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 18 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 19 | .\" | ||
| 20 | .\" This file is a derived work containing a few sentences | ||
| 21 | .\" written by Dr. Stephen Henson <steve@openssl.org> | ||
| 22 | .\" covered by the following license: | ||
| 23 | .\" | ||
| 24 | .\" Copyright (c) 2012 The OpenSSL Project. All rights reserved. | ||
| 25 | .\" | ||
| 26 | .\" Redistribution and use in source and binary forms, with or without | ||
| 27 | .\" modification, are permitted provided that the following conditions | ||
| 28 | .\" are met: | ||
| 29 | .\" | ||
| 30 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 31 | .\" notice, this list of conditions and the following disclaimer. | ||
| 32 | .\" | ||
| 33 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 34 | .\" notice, this list of conditions and the following disclaimer in | ||
| 35 | .\" the documentation and/or other materials provided with the | ||
| 36 | .\" distribution. | ||
| 37 | .\" | ||
| 38 | .\" 3. All advertising materials mentioning features or use of this | ||
| 39 | .\" software must display the following acknowledgment: | ||
| 40 | .\" "This product includes software developed by the OpenSSL Project | ||
| 41 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 42 | .\" | ||
| 43 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 44 | .\" endorse or promote products derived from this software without | ||
| 45 | .\" prior written permission. For written permission, please contact | ||
| 46 | .\" openssl-core@openssl.org. | ||
| 47 | .\" | ||
| 48 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 49 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 50 | .\" permission of the OpenSSL Project. | ||
| 51 | .\" | ||
| 52 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 53 | .\" acknowledgment: | ||
| 54 | .\" "This product includes software developed by the OpenSSL Project | ||
| 55 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 56 | .\" | ||
| 57 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 58 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 59 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 60 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 61 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 62 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 63 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 64 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 65 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 66 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 67 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 68 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 69 | .\" | ||
| 70 | .Dd $Mdocdate: December 17 2024 $ | ||
| 71 | .Dt EVP_AES_128_GCM 3 | ||
| 72 | .Os | ||
| 73 | .Sh NAME | ||
| 74 | .Nm EVP_aes_128_gcm , | ||
| 75 | .Nm EVP_aes_192_gcm , | ||
| 76 | .Nm EVP_aes_256_gcm | ||
| 77 | .Nd EVP AES cipher in Galois Counter Mode | ||
| 78 | .Sh SYNOPSIS | ||
| 79 | .In openssl/evp.h | ||
| 80 | .Ft const EVP_CIPHER * | ||
| 81 | .Fn EVP_aes_128_gcm void | ||
| 82 | .Ft const EVP_CIPHER * | ||
| 83 | .Fn EVP_aes_192_gcm void | ||
| 84 | .Ft const EVP_CIPHER * | ||
| 85 | .Fn EVP_aes_256_gcm void | ||
| 86 | .Sh DESCRIPTION | ||
| 87 | .Fn EVP_aes_128_gcm , | ||
| 88 | .Fn EVP_aes_192_gcm , | ||
| 89 | and | ||
| 90 | .Fn EVP_aes_256_gcm | ||
| 91 | provide the Advanced Encryption Standard algorithm for 128, 192 and 256-bit | ||
| 92 | keys in and Galois Counter Mode in the | ||
| 93 | .Xr evp 3 | ||
| 94 | framework. | ||
| 95 | .Pp | ||
| 96 | For GCM mode ciphers, the behaviour of the EVP interface is subtly | ||
| 97 | altered and several additional | ||
| 98 | .Xr EVP_CIPHER_CTX_ctrl 3 | ||
| 99 | operations are required to function correctly. | ||
| 100 | .Pp | ||
| 101 | To avoid using the cumbersome and error-prone API documented | ||
| 102 | in the present manual page, consider using the functions documented in | ||
| 103 | .Xr EVP_AEAD_CTX_init 3 | ||
| 104 | instead. | ||
| 105 | .Ss Configuration controls | ||
| 106 | .\" The following constants are intentionally undocumented | ||
| 107 | .\" because they are very rarely used in application programs: | ||
| 108 | .\" EVP_GCM_TLS_FIXED_IV_LEN (unused in the library) | ||
| 109 | .\" EVP_GCM_TLS_EXPLICIT_IV_LEN and EVP_GCM_TLS_TAG_LEN (used internally | ||
| 110 | .\" only in aes_gcm_tls_cipher(), which is unused) | ||
| 111 | .Bl -tag -width Ds | ||
| 112 | .It Dv EVP_CTRL_GCM_SET_IVLEN | ||
| 113 | Set the length of the initialization vector to | ||
| 114 | .Fa arg | ||
| 115 | bytes; the | ||
| 116 | .Fa ptr | ||
| 117 | argument is ignored and passing | ||
| 118 | .Dv NULL | ||
| 119 | is recommended. | ||
| 120 | This call can only be made before specifying an initialization vector. | ||
| 121 | If not called, the default IV length of 12 bytes is used. | ||
| 122 | .Pp | ||
| 123 | Using this control command is discouraged because section 5.2.1.1 of the | ||
| 124 | specification explicitly recommends that implementations of GCM restrict | ||
| 125 | support to the default IV length of 12 bytes for interoperability, | ||
| 126 | efficiency, and simplicity of design. | ||
| 127 | .It Dv EVP_CTRL_GCM_SET_IV_FIXED | ||
| 128 | Usually, \-1 is passed for | ||
| 129 | .Fa arg . | ||
| 130 | In that case, the complete initialization vector is copied from | ||
| 131 | .Fa ptr . | ||
| 132 | .Pp | ||
| 133 | Otherwise, set the fixed field at the beginning of the initialization | ||
| 134 | vector to the | ||
| 135 | .Fa arg | ||
| 136 | bytes pointed to by | ||
| 137 | .Fa ptr . | ||
| 138 | When encrypting, also generate the remaining bytes | ||
| 139 | of the initialization vector at random. | ||
| 140 | It is an error to specify an | ||
| 141 | .Fa arg | ||
| 142 | that is less than 4 or so large that less than 8 bytes remain. | ||
| 143 | .El | ||
| 144 | .Ss Encryption controls | ||
| 145 | .Bl -tag -width Ds | ||
| 146 | .It Dv EVP_CTRL_GCM_IV_GEN | ||
| 147 | Generate the precounter block from the initialization vector, | ||
| 148 | copy the last | ||
| 149 | .Fa arg | ||
| 150 | bytes of the initialization vector to the location pointed to by | ||
| 151 | .Fa ptr , | ||
| 152 | or all of it if | ||
| 153 | .Fa arg | ||
| 154 | is less than 1 or greater than the length of the initialization vector, | ||
| 155 | and increment the initialization vector by 1. | ||
| 156 | Incrementing ignores the IV length and the fixed field length | ||
| 157 | that may have been configured earlier and always operates on the | ||
| 158 | last eight bytes of the initialization vector. | ||
| 159 | It is an error to issue this command | ||
| 160 | when no key or no initialization vector is set. | ||
| 161 | .It Dv EVP_CTRL_GCM_GET_TAG | ||
| 162 | Write | ||
| 163 | .Fa arg | ||
| 164 | bytes of the tag value to the location pointed to by | ||
| 165 | .Fa ptr . | ||
| 166 | This control command only makes sense after all data has been processed, | ||
| 167 | e.g. after calling | ||
| 168 | .Xr EVP_EncryptFinal 3 . | ||
| 169 | It is an error to issue this command while decrypting, | ||
| 170 | before any data has been processed, or to specify an | ||
| 171 | .Fa arg | ||
| 172 | that is less than 1 or greater than 16. | ||
| 173 | .El | ||
| 174 | .Pp | ||
| 175 | To specify any additional authenticated data (AAD), call | ||
| 176 | .Xr EVP_EncryptUpdate 3 | ||
| 177 | with the | ||
| 178 | .Fa out | ||
| 179 | argument set to | ||
| 180 | .Dv NULL . | ||
| 181 | .Ss Decryption controls | ||
| 182 | .Bl -tag -width Ds | ||
| 183 | .It Dv EVP_CTRL_GCM_SET_IV_INV | ||
| 184 | Copy | ||
| 185 | .Fa arg | ||
| 186 | bytes from | ||
| 187 | .Fa ptr | ||
| 188 | to the last bytes of the initialization vector | ||
| 189 | and generate the precounter block from the initialization vector. | ||
| 190 | The library does not check whether the arguments are consistent | ||
| 191 | with the configured initialization vector and fixed field lengths. | ||
| 192 | When default lengths are in use, pass 8 for | ||
| 193 | .Fa arg . | ||
| 194 | In that case, this control command sets the invocation field. | ||
| 195 | It is an error to issue this command | ||
| 196 | when no key or no initialization vector is set, or when encrypting. | ||
| 197 | .It Dv EVP_CTRL_GCM_SET_TAG | ||
| 198 | Set the expected tag to the | ||
| 199 | .Fa arg | ||
| 200 | bytes located at | ||
| 201 | .Fa ptr . | ||
| 202 | This control command is mandatory before any data is processed, | ||
| 203 | e.g. before calling | ||
| 204 | .Xr EVP_DecryptUpdate 3 . | ||
| 205 | It is an error to issue this command while encrypting or to specify an | ||
| 206 | .Fa arg | ||
| 207 | that is less than 1 or greater than 16. | ||
| 208 | .El | ||
| 209 | .Pp | ||
| 210 | To specify any additional authenticated data (AAD), call | ||
| 211 | .Xr EVP_DecryptUpdate 3 | ||
| 212 | with the | ||
| 213 | .Fa out | ||
| 214 | argument set to | ||
| 215 | .Dv NULL . | ||
| 216 | .Pp | ||
| 217 | If the return value of | ||
| 218 | .Xr EVP_DecryptFinal 3 , | ||
| 219 | .Xr EVP_DecryptFinal_ex 3 , | ||
| 220 | .Xr EVP_CipherFinal 3 , | ||
| 221 | or | ||
| 222 | .Xr EVP_CipherFinal_ex 3 | ||
| 223 | does not indicate success when decrypting, | ||
| 224 | the authentication operation failed. | ||
| 225 | In that case, regard any output data as corrupted. | ||
| 226 | .Sh SEE ALSO | ||
| 227 | .Xr AES_encrypt 3 , | ||
| 228 | .Xr evp 3 , | ||
| 229 | .Xr EVP_AEAD_CTX_init 3 , | ||
| 230 | .Xr EVP_aes_128_cbc 3 , | ||
| 231 | .Xr EVP_CIPHER_CTX_ctrl 3 , | ||
| 232 | .Xr EVP_EncryptInit 3 | ||
| 233 | .Sh STANDARDS | ||
| 234 | .Rs | ||
| 235 | .%A Morris Dworkin | ||
| 236 | .%I National Institute of Standards and Technology | ||
| 237 | .%R Recommendation for Block Cipher Modes of Operation:\ | ||
| 238 | Galois/Counter Mode (GCM) and GMAC | ||
| 239 | .%N NIST Special Publication 800-38D | ||
| 240 | .%C Gaithersburg, Maryland | ||
| 241 | .%D November 2007 | ||
| 242 | .Re | ||
| 243 | .Sh HISTORY | ||
| 244 | .Fn EVP_aes_128_gcm , | ||
| 245 | .Fn EVP_aes_192_gcm , | ||
| 246 | and | ||
| 247 | .Fn EVP_aes_256_gcm | ||
| 248 | first appeared in OpenSSL 1.0.1 and have been available since | ||
| 249 | .Ox 5.3 . | ||
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index c69fe73af2..137540c69a 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.300 2024/12/08 17:41:23 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.301 2024/12/17 18:11:44 schwarze Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
| 4 | 4 | ||
| @@ -196,6 +196,7 @@ MAN= \ | |||
| 196 | EVP_SignInit.3 \ | 196 | EVP_SignInit.3 \ |
| 197 | EVP_VerifyInit.3 \ | 197 | EVP_VerifyInit.3 \ |
| 198 | EVP_aes_128_cbc.3 \ | 198 | EVP_aes_128_cbc.3 \ |
| 199 | EVP_aes_128_gcm.3 \ | ||
| 199 | EVP_camellia_128_cbc.3 \ | 200 | EVP_camellia_128_cbc.3 \ |
| 200 | EVP_chacha20.3 \ | 201 | EVP_chacha20.3 \ |
| 201 | EVP_des_cbc.3 \ | 202 | EVP_des_cbc.3 \ |
