diff options
| author | schwarze <> | 2019-08-28 10:37:42 +0000 |
|---|---|---|
| committer | schwarze <> | 2019-08-28 10:37:42 +0000 |
| commit | 162bae9b2695b73db0a85e0625e3bfecfa4c1eab (patch) | |
| tree | cce87ea0ddb5bdaf5728bb00b7a12391053371d9 /src | |
| parent | 6432defbbab7c9dc0efc0392eee974b3083262af (diff) | |
| download | openbsd-162bae9b2695b73db0a85e0625e3bfecfa4c1eab.tar.gz openbsd-162bae9b2695b73db0a85e0625e3bfecfa4c1eab.tar.bz2 openbsd-162bae9b2695b73db0a85e0625e3bfecfa4c1eab.zip | |
new manual page AES_encrypt(3)
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/AES_encrypt.3 | 173 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/EVP_aes_128_cbc.3 | 5 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/crypto.3 | 5 |
4 files changed, 181 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/AES_encrypt.3 b/src/lib/libcrypto/man/AES_encrypt.3 new file mode 100644 index 0000000000..f022848a61 --- /dev/null +++ b/src/lib/libcrypto/man/AES_encrypt.3 | |||
| @@ -0,0 +1,173 @@ | |||
| 1 | .\" $OpenBSD: AES_encrypt.3,v 1.1 2019/08/28 10:37:42 schwarze Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org> | ||
| 4 | .\" | ||
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .\" | ||
| 17 | .Dd $Mdocdate: August 28 2019 $ | ||
| 18 | .Dt AES_ENCRYPT 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm AES_set_encrypt_key , | ||
| 22 | .Nm AES_set_decrypt_key , | ||
| 23 | .Nm AES_encrypt , | ||
| 24 | .Nm AES_decrypt , | ||
| 25 | .Nm AES_cbc_encrypt | ||
| 26 | .Nd low-level interface to the AES symmetric cipher | ||
| 27 | .Sh SYNOPSIS | ||
| 28 | .In openssl/aes.h | ||
| 29 | .Ft int | ||
| 30 | .Fo AES_set_encrypt_key | ||
| 31 | .Fa "const unsigned char *userKey" | ||
| 32 | .Fa "const int bits" | ||
| 33 | .Fa "AES_KEY *key" | ||
| 34 | .Fc | ||
| 35 | .Ft int | ||
| 36 | .Fo AES_set_decrypt_key | ||
| 37 | .Fa "const unsigned char *userKey" | ||
| 38 | .Fa "const int bits" | ||
| 39 | .Fa "AES_KEY *key" | ||
| 40 | .Fc | ||
| 41 | .Ft void | ||
| 42 | .Fo AES_encrypt | ||
| 43 | .Fa "const unsigned char *in" | ||
| 44 | .Fa "unsigned char *out" | ||
| 45 | .Fa "const AES_KEY *key" | ||
| 46 | .Fc | ||
| 47 | .Ft void | ||
| 48 | .Fo AES_decrypt | ||
| 49 | .Fa "const unsigned char *in" | ||
| 50 | .Fa "unsigned char *out" | ||
| 51 | .Fa "const AES_KEY *key" | ||
| 52 | .Fc | ||
| 53 | .Ft void | ||
| 54 | .Fo AES_cbc_encrypt | ||
| 55 | .Fa "const unsigned char *in" | ||
| 56 | .Fa "unsigned char *out" | ||
| 57 | .Fa "size_t length" | ||
| 58 | .Fa "const AES_KEY *key" | ||
| 59 | .Fa "unsigned char *ivec" | ||
| 60 | .Fa "const int enc" | ||
| 61 | .Fc | ||
| 62 | .Sh DESCRIPTION | ||
| 63 | These function provide a low-level interface to the AES symmetric | ||
| 64 | cipher algorithm, also called Rijndael. | ||
| 65 | For reasons of flexibility, it is recommended that application | ||
| 66 | programs use the high-level interface described in | ||
| 67 | .Xr EVP_EncryptInit 3 | ||
| 68 | and | ||
| 69 | .Xr EVP_aes_128_cbc 3 | ||
| 70 | instead whenever possible. | ||
| 71 | .Pp | ||
| 72 | .Vt AES_KEY | ||
| 73 | is a structure that can hold up to 60 | ||
| 74 | .Vt int | ||
| 75 | values and a number of rounds. | ||
| 76 | .Pp | ||
| 77 | .Fn AES_set_encrypt_key | ||
| 78 | expands the | ||
| 79 | .Fa userKey , | ||
| 80 | which is | ||
| 81 | .Fa bits | ||
| 82 | long, into the | ||
| 83 | .Fa key | ||
| 84 | structure to prepare for encryption. | ||
| 85 | The number of bits and bytes read from | ||
| 86 | .Fa userKey , | ||
| 87 | the number of | ||
| 88 | .Vt int | ||
| 89 | values stored into | ||
| 90 | .Fa key , | ||
| 91 | and the number of rounds are as follows: | ||
| 92 | .Pp | ||
| 93 | .Bl -column bits bytes ints rounds -offset indent -compact | ||
| 94 | .It bits Ta bytes Ta ints Ta rounds | ||
| 95 | .It 128 Ta 16 Ta 44 Ta 10 | ||
| 96 | .It 192 Ta 24 Ta 52 Ta 12 | ||
| 97 | .It 256 Ta 32 Ta 60 Ta 14 | ||
| 98 | .El | ||
| 99 | .Pp | ||
| 100 | .Fn AES_set_decrypt_key | ||
| 101 | does the same, but in preparation for decryption. | ||
| 102 | .Pp | ||
| 103 | .Fn AES_encrypt | ||
| 104 | reads a single 16 byte block from | ||
| 105 | .Pf * Fa in , | ||
| 106 | encrypts it with the | ||
| 107 | .Fa key , | ||
| 108 | and writes the 16 resulting bytes to | ||
| 109 | .Pf * Fa out . | ||
| 110 | The 16 byte buffers starting at | ||
| 111 | .Fa in | ||
| 112 | and | ||
| 113 | .Fa out | ||
| 114 | can overlap, and | ||
| 115 | .Fa in | ||
| 116 | and | ||
| 117 | .Fa out | ||
| 118 | can even point to the same memory location. | ||
| 119 | .Pp | ||
| 120 | .Fn AES_decrypt | ||
| 121 | decrypts a single block and is otherwise identical to | ||
| 122 | .Fn AES_encrypt . | ||
| 123 | .Pp | ||
| 124 | If | ||
| 125 | .Fa enc | ||
| 126 | is non-zero, | ||
| 127 | .Fn AES_cbc_encrypt | ||
| 128 | encrypts | ||
| 129 | .Fa len | ||
| 130 | bytes at | ||
| 131 | .Fa in | ||
| 132 | to | ||
| 133 | .Fa out | ||
| 134 | using the 128 bit | ||
| 135 | .Fa key | ||
| 136 | and the 128 bit | ||
| 137 | initialization vector | ||
| 138 | .Fa ivec | ||
| 139 | in CBC mode. | ||
| 140 | If | ||
| 141 | .Fa enc | ||
| 142 | is 0, | ||
| 143 | .Fn AES_cbc_encrypt | ||
| 144 | performs the corresponding decryption. | ||
| 145 | .Sh RETURN VALUES | ||
| 146 | .Fn AES_set_encrypt_key | ||
| 147 | and | ||
| 148 | .Fn AES_set_decrypt_key | ||
| 149 | return 0 for success, -1 if | ||
| 150 | .Fa userKey | ||
| 151 | or | ||
| 152 | .Fa key | ||
| 153 | is | ||
| 154 | .Dv NULL , | ||
| 155 | or -2 if the number of | ||
| 156 | .Fa bits | ||
| 157 | is unsupported. | ||
| 158 | .Sh SEE ALSO | ||
| 159 | .Xr crypto 3 , | ||
| 160 | .Xr EVP_aes_128_cbc 3 , | ||
| 161 | .Xr EVP_EncryptInit 3 | ||
| 162 | .Sh STANDARDS | ||
| 163 | ISO/IEC 18033-3:2010 | ||
| 164 | Information technology \(em Security techniques \(em | ||
| 165 | Encryption algorithms \(em Part 3: Block ciphers | ||
| 166 | .Sh HISTORY | ||
| 167 | These functions first appeared in OpenSSL 0.9.7 | ||
| 168 | and have been available since | ||
| 169 | .Ox 3.2 . | ||
| 170 | .Sh AUTHORS | ||
| 171 | .An Vincent Rijmen | ||
| 172 | .An Antoon Bosselaers | ||
| 173 | .An Paulo Barreto | ||
diff --git a/src/lib/libcrypto/man/EVP_aes_128_cbc.3 b/src/lib/libcrypto/man/EVP_aes_128_cbc.3 index be8e5ff75b..f25df8c7eb 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.2 2019/03/19 19:50:03 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_aes_128_cbc.3,v 1.3 2019/08/28 10:37:42 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: March 19 2019 $ | 51 | .Dd $Mdocdate: August 28 2019 $ |
| 52 | .Dt EVP_AES_128_CBC 3 | 52 | .Dt EVP_AES_128_CBC 3 |
| 53 | .Os | 53 | .Os |
| 54 | .Sh NAME | 54 | .Sh NAME |
| @@ -279,6 +279,7 @@ These functions return an | |||
| 279 | .Vt EVP_CIPHER | 279 | .Vt EVP_CIPHER |
| 280 | structure that provides the implementation of the symmetric cipher. | 280 | structure that provides the implementation of the symmetric cipher. |
| 281 | .Sh SEE ALSO | 281 | .Sh SEE ALSO |
| 282 | .Xr AES_encrypt 3 , | ||
| 282 | .Xr evp 3 , | 283 | .Xr evp 3 , |
| 283 | .Xr EVP_EncryptInit 3 | 284 | .Xr EVP_EncryptInit 3 |
| 284 | .Sh HISTORY | 285 | .Sh HISTORY |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 2938a65cda..840be62d72 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.157 2019/08/26 11:41:31 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.158 2019/08/28 10:37:42 schwarze Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
| 4 | 4 | ||
| 5 | MAN= \ | 5 | MAN= \ |
| 6 | ACCESS_DESCRIPTION_new.3 \ | 6 | ACCESS_DESCRIPTION_new.3 \ |
| 7 | AES_encrypt.3 \ | ||
| 7 | ASN1_INTEGER_get.3 \ | 8 | ASN1_INTEGER_get.3 \ |
| 8 | ASN1_OBJECT_new.3 \ | 9 | ASN1_OBJECT_new.3 \ |
| 9 | ASN1_STRING_length.3 \ | 10 | ASN1_STRING_length.3 \ |
diff --git a/src/lib/libcrypto/man/crypto.3 b/src/lib/libcrypto/man/crypto.3 index bd244ebf4b..f589c6bb0c 100644 --- a/src/lib/libcrypto/man/crypto.3 +++ b/src/lib/libcrypto/man/crypto.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: crypto.3,v 1.21 2019/08/19 13:08:26 schwarze Exp $ | 1 | .\" $OpenBSD: crypto.3,v 1.22 2019/08/28 10:37:42 schwarze Exp $ |
| 2 | .\" OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100 | 2 | .\" OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and |
| @@ -49,7 +49,7 @@ | |||
| 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 51 | .\" | 51 | .\" |
| 52 | .Dd $Mdocdate: August 19 2019 $ | 52 | .Dd $Mdocdate: August 28 2019 $ |
| 53 | .Dt CRYPTO 3 | 53 | .Dt CRYPTO 3 |
| 54 | .Os | 54 | .Os |
| 55 | .Sh NAME | 55 | .Sh NAME |
| @@ -67,6 +67,7 @@ including AES, Blowfish, CAST, Chacha20, IDEA, DES, RC2, and RC4 | |||
| 67 | are provided by the generic interface | 67 | are provided by the generic interface |
| 68 | .Xr EVP_EncryptInit 3 . | 68 | .Xr EVP_EncryptInit 3 . |
| 69 | Low-level stand-alone interfaces include | 69 | Low-level stand-alone interfaces include |
| 70 | .Xr AES_encrypt 3 , | ||
| 70 | .Xr BF_set_key 3 , | 71 | .Xr BF_set_key 3 , |
| 71 | .Xr DES_set_key 3 , | 72 | .Xr DES_set_key 3 , |
| 72 | and | 73 | and |
