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