diff options
Diffstat (limited to 'src/lib/libcrypto/man/EVP_rc2_cbc.3')
-rw-r--r-- | src/lib/libcrypto/man/EVP_rc2_cbc.3 | 201 |
1 files changed, 0 insertions, 201 deletions
diff --git a/src/lib/libcrypto/man/EVP_rc2_cbc.3 b/src/lib/libcrypto/man/EVP_rc2_cbc.3 deleted file mode 100644 index 38c8184260..0000000000 --- a/src/lib/libcrypto/man/EVP_rc2_cbc.3 +++ /dev/null | |||
@@ -1,201 +0,0 @@ | |||
1 | .\" $OpenBSD: EVP_rc2_cbc.3,v 1.1 2024/12/08 17:41:23 schwarze Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2024 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: December 8 2024 $ | ||
18 | .Dt EVP_RC2_CBC 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm EVP_rc2_cbc , | ||
22 | .Nm EVP_rc2_ecb , | ||
23 | .Nm EVP_rc2_cfb64 , | ||
24 | .Nm EVP_rc2_cfb , | ||
25 | .Nm EVP_rc2_ofb , | ||
26 | .Nm EVP_rc2_40_cbc , | ||
27 | .Nm EVP_rc2_64_cbc | ||
28 | .Nd Rivest Cipher 2 in the EVP framework | ||
29 | .Sh SYNOPSIS | ||
30 | .In openssl/evp.h | ||
31 | .Ft const EVP_CIPHER * | ||
32 | .Fn EVP_rc2_cbc void | ||
33 | .Ft const EVP_CIPHER * | ||
34 | .Fn EVP_rc2_ecb void | ||
35 | .Ft const EVP_CIPHER * | ||
36 | .Fn EVP_rc2_cfb64 void | ||
37 | .Ft const EVP_CIPHER * | ||
38 | .Fn EVP_rc2_cfb void | ||
39 | .Ft const EVP_CIPHER * | ||
40 | .Fn EVP_rc2_ofb void | ||
41 | .Ft const EVP_CIPHER * | ||
42 | .Fn EVP_rc2_40_cbc void | ||
43 | .Ft const EVP_CIPHER * | ||
44 | .Fn EVP_rc2_64_cbc void | ||
45 | .In openssl/rc2.h | ||
46 | .Fd #define RC2_BLOCK 8 | ||
47 | .Fd #define RC2_KEY_LENGTH 16 | ||
48 | .Sh DESCRIPTION | ||
49 | RC2 is a block cipher operating on blocks of | ||
50 | .Dv RC2_BLOCK No = 8 | ||
51 | bytes, equivalent to 64 bits, using a variable | ||
52 | .Fa key | ||
53 | length with an additional parameter called | ||
54 | .Dq effective key bits | ||
55 | or | ||
56 | .Dq effective key length . | ||
57 | .Pp | ||
58 | .Fn EVP_rc2_cbc , | ||
59 | .Fn EVP_rc2_ecb , | ||
60 | .Fn EVP_rc2_cfb64 , | ||
61 | and | ||
62 | .Fn EVP_rc2_ofb | ||
63 | provide the RC2 encryption algorithm in CBC, ECB, CFB and OFB mode, | ||
64 | respectively. | ||
65 | .Fn EVP_rc2_cfb | ||
66 | is an alias for | ||
67 | .Fn EVP_rc2_cfb64 , | ||
68 | implemented as a macro. | ||
69 | .Pp | ||
70 | By default, these functions set both the key length | ||
71 | and the effective key length to | ||
72 | .Dv RC2_KEY_LENGTH No = 16 | ||
73 | bytes, which is not a very useful value because it is quite short. | ||
74 | .Pp | ||
75 | Configuring normally requires a multi-step process: | ||
76 | .Bl -enum -width 2n | ||
77 | .It | ||
78 | Create a new, empty | ||
79 | .Vt EVP_CIPHER_CTX | ||
80 | object with | ||
81 | .Xr EVP_CIPHER_CTX_new 3 . | ||
82 | .It | ||
83 | Select the operation mode by calling | ||
84 | .Xr EVP_EncryptInit 3 | ||
85 | with the desired | ||
86 | .Fa type | ||
87 | argument, passing | ||
88 | .Dv NULL | ||
89 | pointers for the | ||
90 | .Fa key | ||
91 | and | ||
92 | .Fa iv | ||
93 | arguments. | ||
94 | .It | ||
95 | Select the | ||
96 | .Fa key | ||
97 | length by passing the desired number of bytes to | ||
98 | .Xr EVP_CIPHER_CTX_set_key_length 3 . | ||
99 | Doing so overrides the default key length of | ||
100 | .Dv RC2_KEY_LENGTH No = 16 . | ||
101 | Valid values for | ||
102 | .Fa keylen | ||
103 | are positive and less than or equal to 128. | ||
104 | .It | ||
105 | Select the effective key length by calling | ||
106 | .Xr EVP_CIPHER_CTX_ctrl 3 | ||
107 | with a | ||
108 | .Fa type | ||
109 | argument of | ||
110 | .Dv EVP_CTRL_SET_RC2_KEY_BITS , | ||
111 | passing the desired number of bits in | ||
112 | .Fa arg . | ||
113 | Doing so overrides the default effective key length of 128 bits. | ||
114 | Valid values for | ||
115 | .Fa arg | ||
116 | are positive and less than or equal to 1024. | ||
117 | The | ||
118 | .Fa ptr | ||
119 | argument is ignored; passing | ||
120 | .Dv NULL | ||
121 | is recommended. | ||
122 | .It | ||
123 | Call | ||
124 | .Xr EVP_EncryptInit 3 | ||
125 | a second time, this time passing | ||
126 | .Dv NULL | ||
127 | for the type argument. | ||
128 | The | ||
129 | .Fa key | ||
130 | argument points to an array containing the number of bytes that was passed to | ||
131 | .Xr EVP_CIPHER_CTX_set_key_length 3 , | ||
132 | and the | ||
133 | .Fa iv | ||
134 | argument points to an array of eight bytes. | ||
135 | .It | ||
136 | Finally, | ||
137 | .Xr EVP_EncryptUpdate 3 | ||
138 | and | ||
139 | .Xr EVP_EncryptFinal 3 | ||
140 | can be used in the normal way. | ||
141 | .El | ||
142 | .Pp | ||
143 | Once a | ||
144 | .Fa ctx | ||
145 | object is fully configured, calling | ||
146 | .Xr EVP_CIPHER_CTX_ctrl 3 | ||
147 | with a | ||
148 | .Fa type | ||
149 | argument of | ||
150 | .Dv EVP_CTRL_GET_RC2_KEY_BITS | ||
151 | interprets | ||
152 | .Fa ptr | ||
153 | as a pointer to | ||
154 | .Vt int | ||
155 | and stores the effective key length in bits at that location. | ||
156 | In this case, | ||
157 | .Fa arg | ||
158 | is ignored and passing 0 is recommended. | ||
159 | .Pp | ||
160 | In the CFB and OFB modes, the minimum required total length in bytes | ||
161 | of the output buffer is equal to the total number of input bytes to | ||
162 | be encoded. | ||
163 | In the CBC and ECB modes, the minimum required total length | ||
164 | of the output buffer has to be rounded up to the next multiple | ||
165 | of the block size of eight bytes. | ||
166 | .Pp | ||
167 | .Fn EVP_rc2_40_cbc | ||
168 | and | ||
169 | .Fn EVP_rc2_64_cbc | ||
170 | are obsolete functions that provide the RC2 algorithm in CBC mode | ||
171 | with a key length and an effective key length of 40 and 64 bits, | ||
172 | respectively. | ||
173 | .Sh RETURN VALUES | ||
174 | With the | ||
175 | .Vt EVP_CIPHER | ||
176 | objects documented in the present manual page, | ||
177 | .Fn EVP_CIPHER_CTX_ctrl | ||
178 | returns 1 for success or 0 if an error occurs. | ||
179 | .Sh SEE ALSO | ||
180 | .Xr evp 3 , | ||
181 | .Xr EVP_CIPHER_CTX_set_key_length 3 , | ||
182 | .Xr EVP_EncryptInit 3 , | ||
183 | .Xr RC2_encrypt 3 | ||
184 | .Sh HISTORY | ||
185 | .Fn EVP_rc2_cbc , | ||
186 | .Fn EVP_rc2_ecb , | ||
187 | .Fn EVP_rc2_cfb , | ||
188 | and | ||
189 | .Fn EVP_rc2_ofb | ||
190 | first appeared in SSLeay 0.5.2 and have been available since | ||
191 | .Ox 2.4 . | ||
192 | .Pp | ||
193 | .Fn EVP_rc2_40_cbc | ||
194 | and | ||
195 | .Fn EVP_rc2_64_cbc | ||
196 | first appeared in SSLeay 0.9.1 and have been available since | ||
197 | .Ox 2.6 . | ||
198 | .Pp | ||
199 | .Fn EVP_rc2_cfb64 | ||
200 | first appeared in OpenSSL 0.9.7e and has been available since | ||
201 | .Ox 3.8 . | ||