diff options
| author | jmc <> | 2016-11-06 18:54:34 +0000 |
|---|---|---|
| committer | jmc <> | 2016-11-06 18:54:34 +0000 |
| commit | 3efac072c03b9d39fefe3d9f97b89134fa486fbb (patch) | |
| tree | ce917e36da781adfcbc395ae0800a1bcdfd89e38 /src | |
| parent | 0c4bf2729017b64bd8f4c250604443791a102dde (diff) | |
| download | openbsd-3efac072c03b9d39fefe3d9f97b89134fa486fbb.tar.gz openbsd-3efac072c03b9d39fefe3d9f97b89134fa486fbb.tar.bz2 openbsd-3efac072c03b9d39fefe3d9f97b89134fa486fbb.zip | |
some cleanup;
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/BF_set_key.3 | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/src/lib/libcrypto/man/BF_set_key.3 b/src/lib/libcrypto/man/BF_set_key.3 index 5eca4409a0..108db57036 100644 --- a/src/lib/libcrypto/man/BF_set_key.3 +++ b/src/lib/libcrypto/man/BF_set_key.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: BF_set_key.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BF_set_key.3,v 1.4 2016/11/06 18:54:34 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 6 2016 $ |
| 4 | .Dt BF_SET_KEY 3 | 4 | .Dt BF_SET_KEY 3 |
| @@ -22,6 +22,16 @@ | |||
| 22 | .Fa "const unsigned char *data" | 22 | .Fa "const unsigned char *data" |
| 23 | .Fc | 23 | .Fc |
| 24 | .Ft void | 24 | .Ft void |
| 25 | .Fo BF_encrypt | ||
| 26 | .Fa "BF_LONG *data" | ||
| 27 | .Fa "const BF_KEY *key" | ||
| 28 | .Fc | ||
| 29 | .Ft void | ||
| 30 | .Fo BF_decrypt | ||
| 31 | .Fa "BF_LONG *data" | ||
| 32 | .Fa "const BF_KEY *key" | ||
| 33 | .Fc | ||
| 34 | .Ft void | ||
| 25 | .Fo BF_ecb_encrypt | 35 | .Fo BF_ecb_encrypt |
| 26 | .Fa "const unsigned char *in" | 36 | .Fa "const unsigned char *in" |
| 27 | .Fa "unsigned char *out" | 37 | .Fa "unsigned char *out" |
| @@ -60,27 +70,19 @@ | |||
| 60 | .Fo BF_options | 70 | .Fo BF_options |
| 61 | .Fa void | 71 | .Fa void |
| 62 | .Fc | 72 | .Fc |
| 63 | .Ft void | ||
| 64 | .Fo BF_encrypt | ||
| 65 | .Fa "BF_LONG *data" | ||
| 66 | .Fa "const BF_KEY *key" | ||
| 67 | .Fc | ||
| 68 | .Ft void | ||
| 69 | .Fo BF_decrypt | ||
| 70 | .Fa "BF_LONG *data" | ||
| 71 | .Fa "const BF_KEY *key" | ||
| 72 | .Fc | ||
| 73 | .Sh DESCRIPTION | 73 | .Sh DESCRIPTION |
| 74 | This library implements the Blowfish cipher, | 74 | This library implements the Blowfish cipher, |
| 75 | which was invented and described by | 75 | which was invented and defined by |
| 76 | .An Counterpane . | 76 | .An Counterpane . |
| 77 | Note that applications should use higher level functions such as | ||
| 78 | .Xr EVP_EncryptInit 3 | ||
| 79 | instead of calling the Blowfish functions directly. | ||
| 77 | .Pp | 80 | .Pp |
| 78 | Blowfish is a block cipher that operates on 64 bit (8 byte) blocks of data. | 81 | Blowfish is a block cipher that operates on 64-bit (8 byte) blocks of data. |
| 79 | It uses a variable size key, but typically, 128 bit (16 byte) keys | 82 | It uses a variable size key, but typically, 128-bit (16 byte) keys |
| 80 | are considered good for strong encryption. | 83 | are considered good for strong encryption. |
| 81 | Blowfish can be used in the same modes as DES (see | 84 | Blowfish can be used in the same modes as DES |
| 82 | .Xr des_modes 3 ) . | 85 | and is currently one of the faster block ciphers. |
| 83 | Blowfish is currently one of the faster block ciphers. | ||
| 84 | It is quite a bit faster than DES, and much faster than IDEA or RC2. | 86 | It is quite a bit faster than DES, and much faster than IDEA or RC2. |
| 85 | .Pp | 87 | .Pp |
| 86 | Blowfish consists of a key setup phase | 88 | Blowfish consists of a key setup phase |
| @@ -139,8 +141,8 @@ and | |||
| 139 | .Fn BF_ofb64_encrypt | 141 | .Fn BF_ofb64_encrypt |
| 140 | are used to encrypt an variable number of bytes (the amount | 142 | are used to encrypt an variable number of bytes (the amount |
| 141 | does not have to be an exact multiple of 8). | 143 | does not have to be an exact multiple of 8). |
| 142 | The purpose of the latter two is to simulate stream ciphers, | 144 | The purpose of the latter two is to simulate stream ciphers and, |
| 143 | and therefore, they need the parameter | 145 | therefore, they need the parameter |
| 144 | .Fa num , | 146 | .Fa num , |
| 145 | which is a pointer to an integer where the current offset in | 147 | which is a pointer to an integer where the current offset in |
| 146 | .Fa ivec | 148 | .Fa ivec |
| @@ -151,7 +153,7 @@ is initialized. | |||
| 151 | .Pp | 153 | .Pp |
| 152 | .Fn BF_cbc_encrypt | 154 | .Fn BF_cbc_encrypt |
| 153 | is the Cipher Block Chaining function for Blowfish. | 155 | is the Cipher Block Chaining function for Blowfish. |
| 154 | It encrypts or decrypts the 64 bits chunks of | 156 | It encrypts or decrypts the 64-bit chunks of |
| 155 | .Fa in | 157 | .Fa in |
| 156 | using the key | 158 | using the key |
| 157 | .Fa schedule , | 159 | .Fa schedule , |
| @@ -164,10 +166,10 @@ or decryption | |||
| 164 | .Pq Dv BF_DECRYPT | 166 | .Pq Dv BF_DECRYPT |
| 165 | shall be performed. | 167 | shall be performed. |
| 166 | .Fa ivec | 168 | .Fa ivec |
| 167 | must point at an 8 byte long initialization vector. | 169 | must point at an 8-byte long initialization vector. |
| 168 | .Pp | 170 | .Pp |
| 169 | .Fn BF_cfb64_encrypt | 171 | .Fn BF_cfb64_encrypt |
| 170 | is the CFB mode for Blowfish with 64 bit feedback. | 172 | is the CFB mode for Blowfish with 64-bit feedback. |
| 171 | It encrypts or decrypts the bytes in | 173 | It encrypts or decrypts the bytes in |
| 172 | .Fa in | 174 | .Fa in |
| 173 | using the key | 175 | using the key |
| @@ -182,12 +184,12 @@ or decryption | |||
| 182 | shall be performed. | 184 | shall be performed. |
| 183 | .Fa ivec | 185 | .Fa ivec |
| 184 | must point at an | 186 | must point at an |
| 185 | 8 byte long initialization vector. | 187 | 8-byte long initialization vector. |
| 186 | .Fa num | 188 | .Fa num |
| 187 | must point at an integer which must be initially zero. | 189 | must point at an integer which must be initially zero. |
| 188 | .Pp | 190 | .Pp |
| 189 | .Fn BF_ofb64_encrypt | 191 | .Fn BF_ofb64_encrypt |
| 190 | is the OFB mode for Blowfish with 64 bit feedback. | 192 | is the OFB mode for Blowfish with 64-bit feedback. |
| 191 | It uses the same parameters as | 193 | It uses the same parameters as |
| 192 | .Fn BF_cfb64_encrypt , | 194 | .Fn BF_cfb64_encrypt , |
| 193 | which must be initialized the same way. | 195 | which must be initialized the same way. |
| @@ -200,18 +202,13 @@ They encrypt/decrypt the first 64 bits of the vector pointed by | |||
| 200 | .Fa data , | 202 | .Fa data , |
| 201 | using the key | 203 | using the key |
| 202 | .Fa key . | 204 | .Fa key . |
| 203 | These functions should not be used unless you implement 'modes' of Blowfish. | 205 | These functions should not be used unless implementing `modes' of Blowfish. |
| 204 | The alternative is to use | 206 | The alternative is to use |
| 205 | .Fn BF_ecb_encrypt . | 207 | .Fn BF_ecb_encrypt . |
| 206 | If you still want to use these functions, you should be aware | 208 | Be aware that these functions take each 32-bit chunk in host-byte order, |
| 207 | that they take each 32-bit chunk in host-byte order, | ||
| 208 | which is little-endian on little-endian platforms | 209 | which is little-endian on little-endian platforms |
| 209 | and big-endian on big-endian ones. | 210 | and big-endian on big-endian ones. |
| 210 | .Sh RETURN VALUES | 211 | .Sh RETURN VALUES |
| 211 | None of the functions presented here return any value. | 212 | None of the functions presented here return any value. |
| 212 | .Sh NOTE | ||
| 213 | Applications should use the higher level functions | ||
| 214 | .Xr EVP_EncryptInit 3 | ||
| 215 | etc. instead of calling the blowfish functions directly. | ||
| 216 | .Sh HISTORY | 213 | .Sh HISTORY |
| 217 | The Blowfish functions are available in all versions of SSLeay and OpenSSL. | 214 | The Blowfish functions are available in all versions of SSLeay and OpenSSL. |
