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