1 /* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */
\r
3 /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
\r
5 * The function names in here are deprecated and are only present to
\r
6 * provide an interface compatible with openssl 0.9.6 and older as
\r
7 * well as libdes. OpenSSL now provides functions where "des_" has
\r
8 * been replaced with "DES_" in the names, to make it possible to
\r
9 * make incompatible changes that are needed for C type security and
\r
12 * This include files has two compatibility modes:
\r
14 * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API
\r
15 * that is compatible with libdes and SSLeay.
\r
16 * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an
\r
17 * API that is compatible with OpenSSL 0.9.5x to 0.9.6x.
\r
19 * Note that these modes break earlier snapshots of OpenSSL, where
\r
20 * libdes compatibility was the only available mode or (later on) the
\r
21 * prefered compatibility mode. However, after much consideration
\r
22 * (and more or less violent discussions with external parties), it
\r
23 * was concluded that OpenSSL should be compatible with earlier versions
\r
24 * of itself before anything else. Also, in all honesty, libdes is
\r
25 * an old beast that shouldn't really be used any more.
\r
27 * Please consider starting to use the DES_ functions rather than the
\r
28 * des_ ones. The des_ functions will disappear completely before
\r
31 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
\r
34 /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
\r
37 /* ====================================================================
\r
38 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
\r
40 * Redistribution and use in source and binary forms, with or without
\r
41 * modification, are permitted provided that the following conditions
\r
44 * 1. Redistributions of source code must retain the above copyright
\r
45 * notice, this list of conditions and the following disclaimer.
\r
47 * 2. Redistributions in binary form must reproduce the above copyright
\r
48 * notice, this list of conditions and the following disclaimer in
\r
49 * the documentation and/or other materials provided with the
\r
52 * 3. All advertising materials mentioning features or use of this
\r
53 * software must display the following acknowledgment:
\r
54 * "This product includes software developed by the OpenSSL Project
\r
55 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
\r
57 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
\r
58 * endorse or promote products derived from this software without
\r
59 * prior written permission. For written permission, please contact
\r
60 * openssl-core@openssl.org.
\r
62 * 5. Products derived from this software may not be called "OpenSSL"
\r
63 * nor may "OpenSSL" appear in their names without prior written
\r
64 * permission of the OpenSSL Project.
\r
66 * 6. Redistributions of any form whatsoever must retain the following
\r
68 * "This product includes software developed by the OpenSSL Project
\r
69 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
\r
71 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
\r
72 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\r
73 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
\r
74 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
\r
75 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
\r
76 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
\r
77 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
\r
78 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
\r
79 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
\r
80 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
\r
81 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
\r
82 * OF THE POSSIBILITY OF SUCH DAMAGE.
\r
83 * ====================================================================
\r
85 * This product includes cryptographic software written by Eric Young
\r
86 * (eay@cryptsoft.com). This product includes software written by Tim
\r
87 * Hudson (tjh@cryptsoft.com).
\r
91 #ifndef HEADER_DES_H
\r
92 #define HEADER_DES_H
\r
94 #include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
\r
96 #ifdef OPENSSL_NO_DES
\r
97 #error DES is disabled.
\r
100 #ifndef HEADER_NEW_DES_H
\r
101 #error You must include des.h, not des_old.h directly.
\r
104 #ifdef _KERBEROS_DES_H
\r
105 #error <openssl/des_old.h> replaces <kerberos/des.h>.
\r
108 #include <openssl/symhacks.h>
\r
110 #ifdef OPENSSL_BUILD_SHLIBCRYPTO
\r
111 # undef OPENSSL_EXTERN
\r
112 # define OPENSSL_EXTERN OPENSSL_EXPORT
\r
119 typedef unsigned char _ossl_old_des_cblock[8];
\r
120 typedef struct _ossl_old_des_ks_struct
\r
123 _ossl_old_des_cblock _;
\r
124 /* make sure things are correct size on machines with
\r
128 } _ossl_old_des_key_schedule[16];
\r
130 #ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
\r
131 #define des_cblock DES_cblock
\r
132 #define const_des_cblock const_DES_cblock
\r
133 #define des_key_schedule DES_key_schedule
\r
134 #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
\r
135 DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
\r
136 #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
\r
137 DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
\r
138 #define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
\r
139 DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
\r
140 #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
\r
141 DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
\r
142 #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
\r
143 DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
\r
144 #define des_options()\
\r
146 #define des_cbc_cksum(i,o,l,k,iv)\
\r
147 DES_cbc_cksum((i),(o),(l),&(k),(iv))
\r
148 #define des_cbc_encrypt(i,o,l,k,iv,e)\
\r
149 DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
\r
150 #define des_ncbc_encrypt(i,o,l,k,iv,e)\
\r
151 DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
\r
152 #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
\r
153 DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
\r
154 #define des_cfb_encrypt(i,o,n,l,k,iv,e)\
\r
155 DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
\r
156 #define des_ecb_encrypt(i,o,k,e)\
\r
157 DES_ecb_encrypt((i),(o),&(k),(e))
\r
158 #define des_encrypt1(d,k,e)\
\r
159 DES_encrypt1((d),&(k),(e))
\r
160 #define des_encrypt2(d,k,e)\
\r
161 DES_encrypt2((d),&(k),(e))
\r
162 #define des_encrypt3(d,k1,k2,k3)\
\r
163 DES_encrypt3((d),&(k1),&(k2),&(k3))
\r
164 #define des_decrypt3(d,k1,k2,k3)\
\r
165 DES_decrypt3((d),&(k1),&(k2),&(k3))
\r
166 #define des_xwhite_in2out(k,i,o)\
\r
167 DES_xwhite_in2out((k),(i),(o))
\r
168 #define des_enc_read(f,b,l,k,iv)\
\r
169 DES_enc_read((f),(b),(l),&(k),(iv))
\r
170 #define des_enc_write(f,b,l,k,iv)\
\r
171 DES_enc_write((f),(b),(l),&(k),(iv))
\r
172 #define des_fcrypt(b,s,r)\
\r
173 DES_fcrypt((b),(s),(r))
\r
175 #define des_crypt(b,s)\
\r
177 #if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
\r
178 #define crypt(b,s)\
\r
182 #define des_ofb_encrypt(i,o,n,l,k,iv)\
\r
183 DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
\r
184 #define des_pcbc_encrypt(i,o,l,k,iv,e)\
\r
185 DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
\r
186 #define des_quad_cksum(i,o,l,c,s)\
\r
187 DES_quad_cksum((i),(o),(l),(c),(s))
\r
188 #define des_random_seed(k)\
\r
189 _ossl_096_des_random_seed((k))
\r
190 #define des_random_key(r)\
\r
191 DES_random_key((r))
\r
192 #define des_read_password(k,p,v) \
\r
193 DES_read_password((k),(p),(v))
\r
194 #define des_read_2passwords(k1,k2,p,v) \
\r
195 DES_read_2passwords((k1),(k2),(p),(v))
\r
196 #define des_set_odd_parity(k)\
\r
197 DES_set_odd_parity((k))
\r
198 #define des_check_key_parity(k)\
\r
199 DES_check_key_parity((k))
\r
200 #define des_is_weak_key(k)\
\r
201 DES_is_weak_key((k))
\r
202 #define des_set_key(k,ks)\
\r
203 DES_set_key((k),&(ks))
\r
204 #define des_key_sched(k,ks)\
\r
205 DES_key_sched((k),&(ks))
\r
206 #define des_set_key_checked(k,ks)\
\r
207 DES_set_key_checked((k),&(ks))
\r
208 #define des_set_key_unchecked(k,ks)\
\r
209 DES_set_key_unchecked((k),&(ks))
\r
210 #define des_string_to_key(s,k)\
\r
211 DES_string_to_key((s),(k))
\r
212 #define des_string_to_2keys(s,k1,k2)\
\r
213 DES_string_to_2keys((s),(k1),(k2))
\r
214 #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
\r
215 DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
\r
216 #define des_ofb64_encrypt(i,o,l,ks,iv,n)\
\r
217 DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
\r
220 #define des_ecb2_encrypt(i,o,k1,k2,e) \
\r
221 des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
\r
223 #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
\r
224 des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
\r
226 #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
\r
227 des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
\r
229 #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
\r
230 des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
\r
232 #define des_check_key DES_check_key
\r
233 #define des_rw_mode DES_rw_mode
\r
234 #else /* libdes compatibility */
\r
235 /* Map all symbol names to _ossl_old_des_* form, so we avoid all
\r
236 clashes with libdes */
\r
237 #define des_cblock _ossl_old_des_cblock
\r
238 #define des_key_schedule _ossl_old_des_key_schedule
\r
239 #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
\r
240 _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
\r
241 #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
\r
242 _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
\r
243 #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
\r
244 _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
\r
245 #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
\r
246 _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
\r
247 #define des_options()\
\r
248 _ossl_old_des_options()
\r
249 #define des_cbc_cksum(i,o,l,k,iv)\
\r
250 _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
\r
251 #define des_cbc_encrypt(i,o,l,k,iv,e)\
\r
252 _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
\r
253 #define des_ncbc_encrypt(i,o,l,k,iv,e)\
\r
254 _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
\r
255 #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
\r
256 _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
\r
257 #define des_cfb_encrypt(i,o,n,l,k,iv,e)\
\r
258 _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
\r
259 #define des_ecb_encrypt(i,o,k,e)\
\r
260 _ossl_old_des_ecb_encrypt((i),(o),(k),(e))
\r
261 #define des_encrypt(d,k,e)\
\r
262 _ossl_old_des_encrypt((d),(k),(e))
\r
263 #define des_encrypt2(d,k,e)\
\r
264 _ossl_old_des_encrypt2((d),(k),(e))
\r
265 #define des_encrypt3(d,k1,k2,k3)\
\r
266 _ossl_old_des_encrypt3((d),(k1),(k2),(k3))
\r
267 #define des_decrypt3(d,k1,k2,k3)\
\r
268 _ossl_old_des_decrypt3((d),(k1),(k2),(k3))
\r
269 #define des_xwhite_in2out(k,i,o)\
\r
270 _ossl_old_des_xwhite_in2out((k),(i),(o))
\r
271 #define des_enc_read(f,b,l,k,iv)\
\r
272 _ossl_old_des_enc_read((f),(b),(l),(k),(iv))
\r
273 #define des_enc_write(f,b,l,k,iv)\
\r
274 _ossl_old_des_enc_write((f),(b),(l),(k),(iv))
\r
275 #define des_fcrypt(b,s,r)\
\r
276 _ossl_old_des_fcrypt((b),(s),(r))
\r
277 #define des_crypt(b,s)\
\r
278 _ossl_old_des_crypt((b),(s))
\r
280 #define crypt(b,s)\
\r
281 _ossl_old_crypt((b),(s))
\r
283 #define des_ofb_encrypt(i,o,n,l,k,iv)\
\r
284 _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
\r
285 #define des_pcbc_encrypt(i,o,l,k,iv,e)\
\r
286 _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
\r
287 #define des_quad_cksum(i,o,l,c,s)\
\r
288 _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
\r
289 #define des_random_seed(k)\
\r
290 _ossl_old_des_random_seed((k))
\r
291 #define des_random_key(r)\
\r
292 _ossl_old_des_random_key((r))
\r
293 #define des_read_password(k,p,v) \
\r
294 _ossl_old_des_read_password((k),(p),(v))
\r
295 #define des_read_2passwords(k1,k2,p,v) \
\r
296 _ossl_old_des_read_2passwords((k1),(k2),(p),(v))
\r
297 #define des_set_odd_parity(k)\
\r
298 _ossl_old_des_set_odd_parity((k))
\r
299 #define des_is_weak_key(k)\
\r
300 _ossl_old_des_is_weak_key((k))
\r
301 #define des_set_key(k,ks)\
\r
302 _ossl_old_des_set_key((k),(ks))
\r
303 #define des_key_sched(k,ks)\
\r
304 _ossl_old_des_key_sched((k),(ks))
\r
305 #define des_string_to_key(s,k)\
\r
306 _ossl_old_des_string_to_key((s),(k))
\r
307 #define des_string_to_2keys(s,k1,k2)\
\r
308 _ossl_old_des_string_to_2keys((s),(k1),(k2))
\r
309 #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
\r
310 _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
\r
311 #define des_ofb64_encrypt(i,o,l,ks,iv,n)\
\r
312 _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
\r
315 #define des_ecb2_encrypt(i,o,k1,k2,e) \
\r
316 des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
\r
318 #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
\r
319 des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
\r
321 #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
\r
322 des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
\r
324 #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
\r
325 des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
\r
327 #define des_check_key DES_check_key
\r
328 #define des_rw_mode DES_rw_mode
\r
331 const char *_ossl_old_des_options(void);
\r
332 void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
\r
333 _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2,
\r
334 _ossl_old_des_key_schedule ks3, int enc);
\r
335 DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
\r
336 long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
\r
337 void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
\r
338 _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
\r
339 void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
\r
340 _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
\r
341 void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
\r
342 _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,
\r
343 _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc);
\r
344 void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits,
\r
345 long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
\r
346 void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
\r
347 _ossl_old_des_key_schedule ks,int enc);
\r
348 void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
\r
349 void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
\r
350 void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
\r
351 _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
\r
352 void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
\r
353 _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
\r
354 void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output,
\r
355 long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
\r
356 _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc);
\r
357 void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
\r
358 long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
\r
359 _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc);
\r
360 void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
\r
361 long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
\r
362 _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num);
\r
364 void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white),
\r
365 _ossl_old_des_cblock (*out_white));
\r
367 int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
\r
368 _ossl_old_des_cblock *iv);
\r
369 int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
\r
370 _ossl_old_des_cblock *iv);
\r
371 char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret);
\r
372 char *_ossl_old_des_crypt(const char *buf,const char *salt);
\r
373 #if !defined(PERL5) && !defined(NeXT)
\r
374 char *_ossl_old_crypt(const char *buf,const char *salt);
\r
376 void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out,
\r
377 int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
\r
378 void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
\r
379 _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
\r
380 DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
\r
381 long length,int out_count,_ossl_old_des_cblock *seed);
\r
382 void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
\r
383 void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
\r
384 int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify);
\r
385 int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2,
\r
386 const char *prompt,int verify);
\r
387 void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
\r
388 int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
\r
389 int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
\r
390 int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
\r
391 void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key);
\r
392 void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2);
\r
393 void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
\r
394 _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc);
\r
395 void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
\r
396 _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num);
\r
398 void _ossl_096_des_random_seed(des_cblock *key);
\r
400 /* The following definitions provide compatibility with the MIT Kerberos
\r
401 * library. The _ossl_old_des_key_schedule structure is not binary compatible. */
\r
403 #define _KERBEROS_DES_H
\r
405 #define KRBDES_ENCRYPT DES_ENCRYPT
\r
406 #define KRBDES_DECRYPT DES_DECRYPT
\r
409 # define ENCRYPT DES_ENCRYPT
\r
410 # define DECRYPT DES_DECRYPT
\r
414 # define C_Block des_cblock
\r
415 # define Key_schedule des_key_schedule
\r
416 # define KEY_SZ DES_KEY_SZ
\r
417 # define string_to_key des_string_to_key
\r
418 # define read_pw_string des_read_pw_string
\r
419 # define random_key des_random_key
\r
420 # define pcbc_encrypt des_pcbc_encrypt
\r
421 # define set_key des_set_key
\r
422 # define key_sched des_key_sched
\r
423 # define ecb_encrypt des_ecb_encrypt
\r
424 # define cbc_encrypt des_cbc_encrypt
\r
425 # define ncbc_encrypt des_ncbc_encrypt
\r
426 # define xcbc_encrypt des_xcbc_encrypt
\r
427 # define cbc_cksum des_cbc_cksum
\r
428 # define quad_cksum des_quad_cksum
\r
429 # define check_parity des_check_key_parity
\r
432 #define des_fixup_key_parity DES_fixup_key_parity
\r
438 /* for DES_read_pw_string et al */
\r
439 #include <openssl/ui_compat.h>
\r