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