1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ssl/libcrypto/src/crypto/des/des_old.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,450 @@
1.4 +/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */
1.5 +
1.6 +/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1.7 + *
1.8 + * The function names in here are deprecated and are only present to
1.9 + * provide an interface compatible with openssl 0.9.6 and older as
1.10 + * well as libdes. OpenSSL now provides functions where "des_" has
1.11 + * been replaced with "DES_" in the names, to make it possible to
1.12 + * make incompatible changes that are needed for C type security and
1.13 + * other stuff.
1.14 + *
1.15 + * This include files has two compatibility modes:
1.16 + *
1.17 + * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API
1.18 + * that is compatible with libdes and SSLeay.
1.19 + * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an
1.20 + * API that is compatible with OpenSSL 0.9.5x to 0.9.6x.
1.21 + *
1.22 + * Note that these modes break earlier snapshots of OpenSSL, where
1.23 + * libdes compatibility was the only available mode or (later on) the
1.24 + * prefered compatibility mode. However, after much consideration
1.25 + * (and more or less violent discussions with external parties), it
1.26 + * was concluded that OpenSSL should be compatible with earlier versions
1.27 + * of itself before anything else. Also, in all honesty, libdes is
1.28 + * an old beast that shouldn't really be used any more.
1.29 + *
1.30 + * Please consider starting to use the DES_ functions rather than the
1.31 + * des_ ones. The des_ functions will disappear completely before
1.32 + * OpenSSL 1.0!
1.33 + *
1.34 + * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1.35 + */
1.36 +
1.37 +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
1.38 + * project 2001.
1.39 + */
1.40 +/* ====================================================================
1.41 + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
1.42 + *
1.43 + * Redistribution and use in source and binary forms, with or without
1.44 + * modification, are permitted provided that the following conditions
1.45 + * are met:
1.46 + *
1.47 + * 1. Redistributions of source code must retain the above copyright
1.48 + * notice, this list of conditions and the following disclaimer.
1.49 + *
1.50 + * 2. Redistributions in binary form must reproduce the above copyright
1.51 + * notice, this list of conditions and the following disclaimer in
1.52 + * the documentation and/or other materials provided with the
1.53 + * distribution.
1.54 + *
1.55 + * 3. All advertising materials mentioning features or use of this
1.56 + * software must display the following acknowledgment:
1.57 + * "This product includes software developed by the OpenSSL Project
1.58 + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
1.59 + *
1.60 + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
1.61 + * endorse or promote products derived from this software without
1.62 + * prior written permission. For written permission, please contact
1.63 + * openssl-core@openssl.org.
1.64 + *
1.65 + * 5. Products derived from this software may not be called "OpenSSL"
1.66 + * nor may "OpenSSL" appear in their names without prior written
1.67 + * permission of the OpenSSL Project.
1.68 + *
1.69 + * 6. Redistributions of any form whatsoever must retain the following
1.70 + * acknowledgment:
1.71 + * "This product includes software developed by the OpenSSL Project
1.72 + * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
1.73 + *
1.74 + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
1.75 + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.76 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1.77 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
1.78 + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1.79 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1.80 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1.81 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.82 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1.83 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1.84 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
1.85 + * OF THE POSSIBILITY OF SUCH DAMAGE.
1.86 + * ====================================================================
1.87 + *
1.88 + * This product includes cryptographic software written by Eric Young
1.89 + * (eay@cryptsoft.com). This product includes software written by Tim
1.90 + * Hudson (tjh@cryptsoft.com).
1.91 + *
1.92 + */
1.93 +/*
1.94 + © Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
1.95 + */
1.96 +
1.97 +#ifndef HEADER_DES_H
1.98 +#define HEADER_DES_H
1.99 +#ifdef SYMBIAN
1.100 +#include <e32def.h>
1.101 +#endif
1.102 +#include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
1.103 +
1.104 +#ifdef OPENSSL_NO_DES
1.105 +#error DES is disabled.
1.106 +#endif
1.107 +
1.108 +#ifndef HEADER_NEW_DES_H
1.109 +#error You must include des.h, not des_old.h directly.
1.110 +#endif
1.111 +
1.112 +#ifdef _KERBEROS_DES_H
1.113 +#error <openssl/des_old.h> replaces <kerberos/des.h>.
1.114 +#endif
1.115 +
1.116 +#include <openssl/symhacks.h>
1.117 +
1.118 +#ifdef OPENSSL_BUILD_SHLIBCRYPTO
1.119 +# undef OPENSSL_EXTERN
1.120 +# define OPENSSL_EXTERN OPENSSL_EXPORT
1.121 +#endif
1.122 +
1.123 +#ifdef __cplusplus
1.124 +extern "C" {
1.125 +#endif
1.126 +
1.127 +#ifdef _
1.128 +#undef _
1.129 +#endif
1.130 +
1.131 +typedef unsigned char _ossl_old_des_cblock[8];
1.132 +typedef struct _ossl_old_des_ks_struct
1.133 + {
1.134 + union {
1.135 + _ossl_old_des_cblock _;
1.136 + /* make sure things are correct size on machines with
1.137 + * 8 byte longs */
1.138 + DES_LONG pad[2];
1.139 + } ks;
1.140 + } _ossl_old_des_key_schedule[16];
1.141 +
1.142 +#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
1.143 +#define des_cblock DES_cblock
1.144 +#define const_des_cblock const_DES_cblock
1.145 +#define des_key_schedule DES_key_schedule
1.146 +#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
1.147 + DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
1.148 +#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
1.149 + DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
1.150 +#define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
1.151 + DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
1.152 +#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
1.153 + DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
1.154 +#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
1.155 + DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
1.156 +#define des_options()\
1.157 + DES_options()
1.158 +#define des_cbc_cksum(i,o,l,k,iv)\
1.159 + DES_cbc_cksum((i),(o),(l),&(k),(iv))
1.160 +#define des_cbc_encrypt(i,o,l,k,iv,e)\
1.161 + DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
1.162 +#define des_ncbc_encrypt(i,o,l,k,iv,e)\
1.163 + DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
1.164 +#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
1.165 + DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
1.166 +#define des_cfb_encrypt(i,o,n,l,k,iv,e)\
1.167 + DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
1.168 +#define des_ecb_encrypt(i,o,k,e)\
1.169 + DES_ecb_encrypt((i),(o),&(k),(e))
1.170 +#define des_encrypt1(d,k,e)\
1.171 + DES_encrypt1((d),&(k),(e))
1.172 +#define des_encrypt2(d,k,e)\
1.173 + DES_encrypt2((d),&(k),(e))
1.174 +#define des_encrypt3(d,k1,k2,k3)\
1.175 + DES_encrypt3((d),&(k1),&(k2),&(k3))
1.176 +#define des_decrypt3(d,k1,k2,k3)\
1.177 + DES_decrypt3((d),&(k1),&(k2),&(k3))
1.178 +#define des_xwhite_in2out(k,i,o)\
1.179 + DES_xwhite_in2out((k),(i),(o))
1.180 +#define des_enc_read(f,b,l,k,iv)\
1.181 + DES_enc_read((f),(b),(l),&(k),(iv))
1.182 +#define des_enc_write(f,b,l,k,iv)\
1.183 + DES_enc_write((f),(b),(l),&(k),(iv))
1.184 +#define des_fcrypt(b,s,r)\
1.185 + DES_fcrypt((b),(s),(r))
1.186 +#if 0
1.187 +#define des_crypt(b,s)\
1.188 + DES_crypt((b),(s))
1.189 +#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
1.190 +#define crypt(b,s)\
1.191 + DES_crypt((b),(s))
1.192 +#endif
1.193 +#endif
1.194 +#define des_ofb_encrypt(i,o,n,l,k,iv)\
1.195 + DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
1.196 +#define des_pcbc_encrypt(i,o,l,k,iv,e)\
1.197 + DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
1.198 +#define des_quad_cksum(i,o,l,c,s)\
1.199 + DES_quad_cksum((i),(o),(l),(c),(s))
1.200 +#define des_random_seed(k)\
1.201 + _ossl_096_des_random_seed((k))
1.202 +#define des_random_key(r)\
1.203 + DES_random_key((r))
1.204 +#define des_read_password(k,p,v) \
1.205 + DES_read_password((k),(p),(v))
1.206 +#define des_read_2passwords(k1,k2,p,v) \
1.207 + DES_read_2passwords((k1),(k2),(p),(v))
1.208 +#define des_set_odd_parity(k)\
1.209 + DES_set_odd_parity((k))
1.210 +#define des_check_key_parity(k)\
1.211 + DES_check_key_parity((k))
1.212 +#define des_is_weak_key(k)\
1.213 + DES_is_weak_key((k))
1.214 +#define des_set_key(k,ks)\
1.215 + DES_set_key((k),&(ks))
1.216 +#define des_key_sched(k,ks)\
1.217 + DES_key_sched((k),&(ks))
1.218 +#define des_set_key_checked(k,ks)\
1.219 + DES_set_key_checked((k),&(ks))
1.220 +#define des_set_key_unchecked(k,ks)\
1.221 + DES_set_key_unchecked((k),&(ks))
1.222 +#define des_string_to_key(s,k)\
1.223 + DES_string_to_key((s),(k))
1.224 +#define des_string_to_2keys(s,k1,k2)\
1.225 + DES_string_to_2keys((s),(k1),(k2))
1.226 +#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
1.227 + DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
1.228 +#define des_ofb64_encrypt(i,o,l,ks,iv,n)\
1.229 + DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
1.230 +
1.231 +
1.232 +#define des_ecb2_encrypt(i,o,k1,k2,e) \
1.233 + des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
1.234 +
1.235 +#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
1.236 + des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
1.237 +
1.238 +#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
1.239 + des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
1.240 +
1.241 +#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
1.242 + des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
1.243 +
1.244 +#define des_check_key DES_check_key
1.245 +#define des_rw_mode DES_rw_mode
1.246 +#else /* libdes compatibility */
1.247 +/* Map all symbol names to _ossl_old_des_* form, so we avoid all
1.248 + clashes with libdes */
1.249 +#define des_cblock _ossl_old_des_cblock
1.250 +#define des_key_schedule _ossl_old_des_key_schedule
1.251 +#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
1.252 + _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
1.253 +#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
1.254 + _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
1.255 +#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
1.256 + _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
1.257 +#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
1.258 + _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
1.259 +#define des_options()\
1.260 + _ossl_old_des_options()
1.261 +#define des_cbc_cksum(i,o,l,k,iv)\
1.262 + _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
1.263 +#define des_cbc_encrypt(i,o,l,k,iv,e)\
1.264 + _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
1.265 +#define des_ncbc_encrypt(i,o,l,k,iv,e)\
1.266 + _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
1.267 +#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
1.268 + _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
1.269 +#define des_cfb_encrypt(i,o,n,l,k,iv,e)\
1.270 + _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
1.271 +#define des_ecb_encrypt(i,o,k,e)\
1.272 + _ossl_old_des_ecb_encrypt((i),(o),(k),(e))
1.273 +#define des_encrypt(d,k,e)\
1.274 + _ossl_old_des_encrypt((d),(k),(e))
1.275 +#define des_encrypt2(d,k,e)\
1.276 + _ossl_old_des_encrypt2((d),(k),(e))
1.277 +#define des_encrypt3(d,k1,k2,k3)\
1.278 + _ossl_old_des_encrypt3((d),(k1),(k2),(k3))
1.279 +#define des_decrypt3(d,k1,k2,k3)\
1.280 + _ossl_old_des_decrypt3((d),(k1),(k2),(k3))
1.281 +#define des_xwhite_in2out(k,i,o)\
1.282 + _ossl_old_des_xwhite_in2out((k),(i),(o))
1.283 +#define des_enc_read(f,b,l,k,iv)\
1.284 + _ossl_old_des_enc_read((f),(b),(l),(k),(iv))
1.285 +#define des_enc_write(f,b,l,k,iv)\
1.286 + _ossl_old_des_enc_write((f),(b),(l),(k),(iv))
1.287 +#define des_fcrypt(b,s,r)\
1.288 + _ossl_old_des_fcrypt((b),(s),(r))
1.289 +#define des_crypt(b,s)\
1.290 + _ossl_old_des_crypt((b),(s))
1.291 +#if 0
1.292 +#define crypt(b,s)\
1.293 + _ossl_old_crypt((b),(s))
1.294 +#endif
1.295 +#define des_ofb_encrypt(i,o,n,l,k,iv)\
1.296 + _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
1.297 +#define des_pcbc_encrypt(i,o,l,k,iv,e)\
1.298 + _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
1.299 +#define des_quad_cksum(i,o,l,c,s)\
1.300 + _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
1.301 +#define des_random_seed(k)\
1.302 + _ossl_old_des_random_seed((k))
1.303 +#define des_random_key(r)\
1.304 + _ossl_old_des_random_key((r))
1.305 +#define des_read_password(k,p,v) \
1.306 + _ossl_old_des_read_password((k),(p),(v))
1.307 +#define des_read_2passwords(k1,k2,p,v) \
1.308 + _ossl_old_des_read_2passwords((k1),(k2),(p),(v))
1.309 +#define des_set_odd_parity(k)\
1.310 + _ossl_old_des_set_odd_parity((k))
1.311 +#define des_is_weak_key(k)\
1.312 + _ossl_old_des_is_weak_key((k))
1.313 +#define des_set_key(k,ks)\
1.314 + _ossl_old_des_set_key((k),(ks))
1.315 +#define des_key_sched(k,ks)\
1.316 + _ossl_old_des_key_sched((k),(ks))
1.317 +#define des_string_to_key(s,k)\
1.318 + _ossl_old_des_string_to_key((s),(k))
1.319 +#define des_string_to_2keys(s,k1,k2)\
1.320 + _ossl_old_des_string_to_2keys((s),(k1),(k2))
1.321 +#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
1.322 + _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
1.323 +#define des_ofb64_encrypt(i,o,l,ks,iv,n)\
1.324 + _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
1.325 +
1.326 +
1.327 +#define des_ecb2_encrypt(i,o,k1,k2,e) \
1.328 + des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
1.329 +
1.330 +#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
1.331 + des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
1.332 +
1.333 +#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
1.334 + des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
1.335 +
1.336 +#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
1.337 + des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
1.338 +
1.339 +#define des_check_key DES_check_key
1.340 +#define des_rw_mode DES_rw_mode
1.341 +#endif
1.342 +
1.343 +IMPORT_C const char *_ossl_old_des_options(void);
1.344 +IMPORT_C void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
1.345 + _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2,
1.346 + _ossl_old_des_key_schedule ks3, int enc);
1.347 +IMPORT_C DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
1.348 + long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
1.349 +IMPORT_C void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
1.350 + _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
1.351 +IMPORT_C void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
1.352 + _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
1.353 +IMPORT_C void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
1.354 + _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,
1.355 + _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc);
1.356 +IMPORT_C void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits,
1.357 + long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
1.358 +IMPORT_C void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
1.359 + _ossl_old_des_key_schedule ks,int enc);
1.360 +IMPORT_C void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
1.361 +IMPORT_C void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
1.362 +IMPORT_C void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
1.363 + _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
1.364 +IMPORT_C void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
1.365 + _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
1.366 +IMPORT_C void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output,
1.367 + long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
1.368 + _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc);
1.369 +IMPORT_C void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
1.370 + long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
1.371 + _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc);
1.372 +IMPORT_C void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
1.373 + long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
1.374 + _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num);
1.375 +
1.376 +IMPORT_C void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white),
1.377 + _ossl_old_des_cblock (*out_white));
1.378 +
1.379 +IMPORT_C int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
1.380 + _ossl_old_des_cblock *iv);
1.381 +IMPORT_C int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
1.382 + _ossl_old_des_cblock *iv);
1.383 +IMPORT_C char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret);
1.384 +IMPORT_C char *_ossl_old_des_crypt(const char *buf,const char *salt);
1.385 +#if !defined(PERL5) && !defined(NeXT)
1.386 +IMPORT_C char *_ossl_old_crypt(const char *buf,const char *salt);
1.387 +#endif
1.388 +IMPORT_C void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out,
1.389 + int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
1.390 +IMPORT_C void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
1.391 + _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
1.392 +IMPORT_C DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
1.393 + long length,int out_count,_ossl_old_des_cblock *seed);
1.394 +IMPORT_C void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
1.395 +IMPORT_C void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
1.396 +IMPORT_C int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify);
1.397 +IMPORT_C int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2,
1.398 + const char *prompt,int verify);
1.399 +IMPORT_C void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
1.400 +IMPORT_C int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
1.401 +IMPORT_C int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
1.402 +IMPORT_C int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
1.403 +IMPORT_C void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key);
1.404 +IMPORT_C void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2);
1.405 +IMPORT_C void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
1.406 + _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc);
1.407 +IMPORT_C void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
1.408 + _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num);
1.409 +
1.410 +IMPORT_C void _ossl_096_des_random_seed(des_cblock *key);
1.411 +
1.412 +/* The following definitions provide compatibility with the MIT Kerberos
1.413 + * library. The _ossl_old_des_key_schedule structure is not binary compatible. */
1.414 +
1.415 +#define _KERBEROS_DES_H
1.416 +
1.417 +#define KRBDES_ENCRYPT DES_ENCRYPT
1.418 +#define KRBDES_DECRYPT DES_DECRYPT
1.419 +
1.420 +#ifdef KERBEROS
1.421 +# define ENCRYPT DES_ENCRYPT
1.422 +# define DECRYPT DES_DECRYPT
1.423 +#endif
1.424 +
1.425 +#ifndef NCOMPAT
1.426 +# define C_Block des_cblock
1.427 +# define Key_schedule des_key_schedule
1.428 +# define KEY_SZ DES_KEY_SZ
1.429 +# define string_to_key des_string_to_key
1.430 +# define read_pw_string des_read_pw_string
1.431 +# define random_key des_random_key
1.432 +# define pcbc_encrypt des_pcbc_encrypt
1.433 +# define set_key des_set_key
1.434 +# define key_sched des_key_sched
1.435 +# define ecb_encrypt des_ecb_encrypt
1.436 +# define cbc_encrypt des_cbc_encrypt
1.437 +# define ncbc_encrypt des_ncbc_encrypt
1.438 +# define xcbc_encrypt des_xcbc_encrypt
1.439 +# define cbc_cksum des_cbc_cksum
1.440 +# define quad_cksum des_quad_cksum
1.441 +# define check_parity des_check_key_parity
1.442 +#endif
1.443 +
1.444 +#define des_fixup_key_parity DES_fixup_key_parity
1.445 +
1.446 +#ifdef __cplusplus
1.447 +}
1.448 +#endif
1.449 +
1.450 +/* for DES_read_pw_string et al */
1.451 +#include <openssl/ui_compat.h>
1.452 +
1.453 +#endif