sl@0: /* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ sl@0: sl@0: /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING sl@0: * sl@0: * The function names in here are deprecated and are only present to sl@0: * provide an interface compatible with openssl 0.9.6 and older as sl@0: * well as libdes. OpenSSL now provides functions where "des_" has sl@0: * been replaced with "DES_" in the names, to make it possible to sl@0: * make incompatible changes that are needed for C type security and sl@0: * other stuff. sl@0: * sl@0: * This include files has two compatibility modes: sl@0: * sl@0: * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API sl@0: * that is compatible with libdes and SSLeay. sl@0: * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an sl@0: * API that is compatible with OpenSSL 0.9.5x to 0.9.6x. sl@0: * sl@0: * Note that these modes break earlier snapshots of OpenSSL, where sl@0: * libdes compatibility was the only available mode or (later on) the sl@0: * prefered compatibility mode. However, after much consideration sl@0: * (and more or less violent discussions with external parties), it sl@0: * was concluded that OpenSSL should be compatible with earlier versions sl@0: * of itself before anything else. Also, in all honesty, libdes is sl@0: * an old beast that shouldn't really be used any more. sl@0: * sl@0: * Please consider starting to use the DES_ functions rather than the sl@0: * des_ ones. The des_ functions will disappear completely before sl@0: * OpenSSL 1.0! sl@0: * sl@0: * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING sl@0: */ sl@0: sl@0: /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL sl@0: * project 2001. sl@0: */ sl@0: /* ==================================================================== sl@0: * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. sl@0: * sl@0: * Redistribution and use in source and binary forms, with or without sl@0: * modification, are permitted provided that the following conditions sl@0: * are met: sl@0: * sl@0: * 1. Redistributions of source code must retain the above copyright sl@0: * notice, this list of conditions and the following disclaimer. sl@0: * sl@0: * 2. Redistributions in binary form must reproduce the above copyright sl@0: * notice, this list of conditions and the following disclaimer in sl@0: * the documentation and/or other materials provided with the sl@0: * distribution. sl@0: * sl@0: * 3. All advertising materials mentioning features or use of this sl@0: * software must display the following acknowledgment: sl@0: * "This product includes software developed by the OpenSSL Project sl@0: * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" sl@0: * sl@0: * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to sl@0: * endorse or promote products derived from this software without sl@0: * prior written permission. For written permission, please contact sl@0: * openssl-core@openssl.org. sl@0: * sl@0: * 5. Products derived from this software may not be called "OpenSSL" sl@0: * nor may "OpenSSL" appear in their names without prior written sl@0: * permission of the OpenSSL Project. sl@0: * sl@0: * 6. Redistributions of any form whatsoever must retain the following sl@0: * acknowledgment: sl@0: * "This product includes software developed by the OpenSSL Project sl@0: * for use in the OpenSSL Toolkit (http://www.openssl.org/)" sl@0: * sl@0: * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY sl@0: * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE sl@0: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR sl@0: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR sl@0: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, sl@0: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT sl@0: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; sl@0: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) sl@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, sl@0: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) sl@0: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED sl@0: * OF THE POSSIBILITY OF SUCH DAMAGE. sl@0: * ==================================================================== sl@0: * sl@0: * This product includes cryptographic software written by Eric Young sl@0: * (eay@cryptsoft.com). This product includes software written by Tim sl@0: * Hudson (tjh@cryptsoft.com). sl@0: * sl@0: */ sl@0: /* sl@0: © Portions copyright (c) 2006 Nokia Corporation. All rights reserved. sl@0: */ sl@0: sl@0: #ifndef HEADER_DES_H sl@0: #define HEADER_DES_H sl@0: #ifdef SYMBIAN sl@0: #include sl@0: #endif sl@0: #include /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */ sl@0: sl@0: #ifdef OPENSSL_NO_DES sl@0: #error DES is disabled. sl@0: #endif sl@0: sl@0: #ifndef HEADER_NEW_DES_H sl@0: #error You must include des.h, not des_old.h directly. sl@0: #endif sl@0: sl@0: #ifdef _KERBEROS_DES_H sl@0: #error replaces . sl@0: #endif sl@0: sl@0: #include sl@0: sl@0: #ifdef OPENSSL_BUILD_SHLIBCRYPTO sl@0: # undef OPENSSL_EXTERN sl@0: # define OPENSSL_EXTERN OPENSSL_EXPORT sl@0: #endif sl@0: sl@0: #ifdef __cplusplus sl@0: extern "C" { sl@0: #endif sl@0: sl@0: #ifdef _ sl@0: #undef _ sl@0: #endif sl@0: sl@0: typedef unsigned char _ossl_old_des_cblock[8]; sl@0: typedef struct _ossl_old_des_ks_struct sl@0: { sl@0: union { sl@0: _ossl_old_des_cblock _; sl@0: /* make sure things are correct size on machines with sl@0: * 8 byte longs */ sl@0: DES_LONG pad[2]; sl@0: } ks; sl@0: } _ossl_old_des_key_schedule[16]; sl@0: sl@0: #ifndef OPENSSL_DES_LIBDES_COMPATIBILITY sl@0: #define des_cblock DES_cblock sl@0: #define const_des_cblock const_DES_cblock sl@0: #define des_key_schedule DES_key_schedule sl@0: #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ sl@0: DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e)) sl@0: #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ sl@0: DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e)) sl@0: #define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\ sl@0: DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e)) sl@0: #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ sl@0: DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e)) sl@0: #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ sl@0: DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n)) sl@0: #define des_options()\ sl@0: DES_options() sl@0: #define des_cbc_cksum(i,o,l,k,iv)\ sl@0: DES_cbc_cksum((i),(o),(l),&(k),(iv)) sl@0: #define des_cbc_encrypt(i,o,l,k,iv,e)\ sl@0: DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e)) sl@0: #define des_ncbc_encrypt(i,o,l,k,iv,e)\ sl@0: DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e)) sl@0: #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ sl@0: DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e)) sl@0: #define des_cfb_encrypt(i,o,n,l,k,iv,e)\ sl@0: DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e)) sl@0: #define des_ecb_encrypt(i,o,k,e)\ sl@0: DES_ecb_encrypt((i),(o),&(k),(e)) sl@0: #define des_encrypt1(d,k,e)\ sl@0: DES_encrypt1((d),&(k),(e)) sl@0: #define des_encrypt2(d,k,e)\ sl@0: DES_encrypt2((d),&(k),(e)) sl@0: #define des_encrypt3(d,k1,k2,k3)\ sl@0: DES_encrypt3((d),&(k1),&(k2),&(k3)) sl@0: #define des_decrypt3(d,k1,k2,k3)\ sl@0: DES_decrypt3((d),&(k1),&(k2),&(k3)) sl@0: #define des_xwhite_in2out(k,i,o)\ sl@0: DES_xwhite_in2out((k),(i),(o)) sl@0: #define des_enc_read(f,b,l,k,iv)\ sl@0: DES_enc_read((f),(b),(l),&(k),(iv)) sl@0: #define des_enc_write(f,b,l,k,iv)\ sl@0: DES_enc_write((f),(b),(l),&(k),(iv)) sl@0: #define des_fcrypt(b,s,r)\ sl@0: DES_fcrypt((b),(s),(r)) sl@0: #if 0 sl@0: #define des_crypt(b,s)\ sl@0: DES_crypt((b),(s)) sl@0: #if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__) sl@0: #define crypt(b,s)\ sl@0: DES_crypt((b),(s)) sl@0: #endif sl@0: #endif sl@0: #define des_ofb_encrypt(i,o,n,l,k,iv)\ sl@0: DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv)) sl@0: #define des_pcbc_encrypt(i,o,l,k,iv,e)\ sl@0: DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e)) sl@0: #define des_quad_cksum(i,o,l,c,s)\ sl@0: DES_quad_cksum((i),(o),(l),(c),(s)) sl@0: #define des_random_seed(k)\ sl@0: _ossl_096_des_random_seed((k)) sl@0: #define des_random_key(r)\ sl@0: DES_random_key((r)) sl@0: #define des_read_password(k,p,v) \ sl@0: DES_read_password((k),(p),(v)) sl@0: #define des_read_2passwords(k1,k2,p,v) \ sl@0: DES_read_2passwords((k1),(k2),(p),(v)) sl@0: #define des_set_odd_parity(k)\ sl@0: DES_set_odd_parity((k)) sl@0: #define des_check_key_parity(k)\ sl@0: DES_check_key_parity((k)) sl@0: #define des_is_weak_key(k)\ sl@0: DES_is_weak_key((k)) sl@0: #define des_set_key(k,ks)\ sl@0: DES_set_key((k),&(ks)) sl@0: #define des_key_sched(k,ks)\ sl@0: DES_key_sched((k),&(ks)) sl@0: #define des_set_key_checked(k,ks)\ sl@0: DES_set_key_checked((k),&(ks)) sl@0: #define des_set_key_unchecked(k,ks)\ sl@0: DES_set_key_unchecked((k),&(ks)) sl@0: #define des_string_to_key(s,k)\ sl@0: DES_string_to_key((s),(k)) sl@0: #define des_string_to_2keys(s,k1,k2)\ sl@0: DES_string_to_2keys((s),(k1),(k2)) sl@0: #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ sl@0: DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e)) sl@0: #define des_ofb64_encrypt(i,o,l,ks,iv,n)\ sl@0: DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n)) sl@0: sl@0: sl@0: #define des_ecb2_encrypt(i,o,k1,k2,e) \ sl@0: des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) sl@0: sl@0: #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ sl@0: des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) sl@0: sl@0: #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ sl@0: des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) sl@0: sl@0: #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ sl@0: des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) sl@0: sl@0: #define des_check_key DES_check_key sl@0: #define des_rw_mode DES_rw_mode sl@0: #else /* libdes compatibility */ sl@0: /* Map all symbol names to _ossl_old_des_* form, so we avoid all sl@0: clashes with libdes */ sl@0: #define des_cblock _ossl_old_des_cblock sl@0: #define des_key_schedule _ossl_old_des_key_schedule sl@0: #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ sl@0: _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e)) sl@0: #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ sl@0: _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e)) sl@0: #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ sl@0: _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e)) sl@0: #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ sl@0: _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n)) sl@0: #define des_options()\ sl@0: _ossl_old_des_options() sl@0: #define des_cbc_cksum(i,o,l,k,iv)\ sl@0: _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv)) sl@0: #define des_cbc_encrypt(i,o,l,k,iv,e)\ sl@0: _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e)) sl@0: #define des_ncbc_encrypt(i,o,l,k,iv,e)\ sl@0: _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e)) sl@0: #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ sl@0: _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e)) sl@0: #define des_cfb_encrypt(i,o,n,l,k,iv,e)\ sl@0: _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e)) sl@0: #define des_ecb_encrypt(i,o,k,e)\ sl@0: _ossl_old_des_ecb_encrypt((i),(o),(k),(e)) sl@0: #define des_encrypt(d,k,e)\ sl@0: _ossl_old_des_encrypt((d),(k),(e)) sl@0: #define des_encrypt2(d,k,e)\ sl@0: _ossl_old_des_encrypt2((d),(k),(e)) sl@0: #define des_encrypt3(d,k1,k2,k3)\ sl@0: _ossl_old_des_encrypt3((d),(k1),(k2),(k3)) sl@0: #define des_decrypt3(d,k1,k2,k3)\ sl@0: _ossl_old_des_decrypt3((d),(k1),(k2),(k3)) sl@0: #define des_xwhite_in2out(k,i,o)\ sl@0: _ossl_old_des_xwhite_in2out((k),(i),(o)) sl@0: #define des_enc_read(f,b,l,k,iv)\ sl@0: _ossl_old_des_enc_read((f),(b),(l),(k),(iv)) sl@0: #define des_enc_write(f,b,l,k,iv)\ sl@0: _ossl_old_des_enc_write((f),(b),(l),(k),(iv)) sl@0: #define des_fcrypt(b,s,r)\ sl@0: _ossl_old_des_fcrypt((b),(s),(r)) sl@0: #define des_crypt(b,s)\ sl@0: _ossl_old_des_crypt((b),(s)) sl@0: #if 0 sl@0: #define crypt(b,s)\ sl@0: _ossl_old_crypt((b),(s)) sl@0: #endif sl@0: #define des_ofb_encrypt(i,o,n,l,k,iv)\ sl@0: _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv)) sl@0: #define des_pcbc_encrypt(i,o,l,k,iv,e)\ sl@0: _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e)) sl@0: #define des_quad_cksum(i,o,l,c,s)\ sl@0: _ossl_old_des_quad_cksum((i),(o),(l),(c),(s)) sl@0: #define des_random_seed(k)\ sl@0: _ossl_old_des_random_seed((k)) sl@0: #define des_random_key(r)\ sl@0: _ossl_old_des_random_key((r)) sl@0: #define des_read_password(k,p,v) \ sl@0: _ossl_old_des_read_password((k),(p),(v)) sl@0: #define des_read_2passwords(k1,k2,p,v) \ sl@0: _ossl_old_des_read_2passwords((k1),(k2),(p),(v)) sl@0: #define des_set_odd_parity(k)\ sl@0: _ossl_old_des_set_odd_parity((k)) sl@0: #define des_is_weak_key(k)\ sl@0: _ossl_old_des_is_weak_key((k)) sl@0: #define des_set_key(k,ks)\ sl@0: _ossl_old_des_set_key((k),(ks)) sl@0: #define des_key_sched(k,ks)\ sl@0: _ossl_old_des_key_sched((k),(ks)) sl@0: #define des_string_to_key(s,k)\ sl@0: _ossl_old_des_string_to_key((s),(k)) sl@0: #define des_string_to_2keys(s,k1,k2)\ sl@0: _ossl_old_des_string_to_2keys((s),(k1),(k2)) sl@0: #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ sl@0: _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e)) sl@0: #define des_ofb64_encrypt(i,o,l,ks,iv,n)\ sl@0: _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n)) sl@0: sl@0: sl@0: #define des_ecb2_encrypt(i,o,k1,k2,e) \ sl@0: des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) sl@0: sl@0: #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ sl@0: des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) sl@0: sl@0: #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ sl@0: des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) sl@0: sl@0: #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ sl@0: des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) sl@0: sl@0: #define des_check_key DES_check_key sl@0: #define des_rw_mode DES_rw_mode sl@0: #endif sl@0: sl@0: IMPORT_C const char *_ossl_old_des_options(void); sl@0: IMPORT_C void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, sl@0: _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2, sl@0: _ossl_old_des_key_schedule ks3, int enc); sl@0: IMPORT_C DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, sl@0: long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); sl@0: IMPORT_C void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, sl@0: _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); sl@0: IMPORT_C void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, sl@0: _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); sl@0: IMPORT_C void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, sl@0: _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec, sl@0: _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc); sl@0: IMPORT_C void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits, sl@0: long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); sl@0: IMPORT_C void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, sl@0: _ossl_old_des_key_schedule ks,int enc); sl@0: IMPORT_C void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); sl@0: IMPORT_C void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); sl@0: IMPORT_C void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, sl@0: _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); sl@0: IMPORT_C void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, sl@0: _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); sl@0: IMPORT_C void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output, sl@0: long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, sl@0: _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc); sl@0: IMPORT_C void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out, sl@0: long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, sl@0: _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc); sl@0: IMPORT_C void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out, sl@0: long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, sl@0: _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num); sl@0: sl@0: IMPORT_C void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white), sl@0: _ossl_old_des_cblock (*out_white)); sl@0: sl@0: IMPORT_C int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, sl@0: _ossl_old_des_cblock *iv); sl@0: IMPORT_C int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, sl@0: _ossl_old_des_cblock *iv); sl@0: IMPORT_C char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret); sl@0: IMPORT_C char *_ossl_old_des_crypt(const char *buf,const char *salt); sl@0: #if !defined(PERL5) && !defined(NeXT) sl@0: IMPORT_C char *_ossl_old_crypt(const char *buf,const char *salt); sl@0: #endif sl@0: IMPORT_C void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out, sl@0: int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); sl@0: IMPORT_C void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, sl@0: _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); sl@0: IMPORT_C DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, sl@0: long length,int out_count,_ossl_old_des_cblock *seed); sl@0: IMPORT_C void _ossl_old_des_random_seed(_ossl_old_des_cblock key); sl@0: IMPORT_C void _ossl_old_des_random_key(_ossl_old_des_cblock ret); sl@0: IMPORT_C int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify); sl@0: IMPORT_C int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2, sl@0: const char *prompt,int verify); sl@0: IMPORT_C void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key); sl@0: IMPORT_C int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key); sl@0: IMPORT_C int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); sl@0: IMPORT_C int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); sl@0: IMPORT_C void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key); sl@0: IMPORT_C void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2); sl@0: IMPORT_C void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, sl@0: _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc); sl@0: IMPORT_C void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, sl@0: _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num); sl@0: sl@0: IMPORT_C void _ossl_096_des_random_seed(des_cblock *key); sl@0: sl@0: /* The following definitions provide compatibility with the MIT Kerberos sl@0: * library. The _ossl_old_des_key_schedule structure is not binary compatible. */ sl@0: sl@0: #define _KERBEROS_DES_H sl@0: sl@0: #define KRBDES_ENCRYPT DES_ENCRYPT sl@0: #define KRBDES_DECRYPT DES_DECRYPT sl@0: sl@0: #ifdef KERBEROS sl@0: # define ENCRYPT DES_ENCRYPT sl@0: # define DECRYPT DES_DECRYPT sl@0: #endif sl@0: sl@0: #ifndef NCOMPAT sl@0: # define C_Block des_cblock sl@0: # define Key_schedule des_key_schedule sl@0: # define KEY_SZ DES_KEY_SZ sl@0: # define string_to_key des_string_to_key sl@0: # define read_pw_string des_read_pw_string sl@0: # define random_key des_random_key sl@0: # define pcbc_encrypt des_pcbc_encrypt sl@0: # define set_key des_set_key sl@0: # define key_sched des_key_sched sl@0: # define ecb_encrypt des_ecb_encrypt sl@0: # define cbc_encrypt des_cbc_encrypt sl@0: # define ncbc_encrypt des_ncbc_encrypt sl@0: # define xcbc_encrypt des_xcbc_encrypt sl@0: # define cbc_cksum des_cbc_cksum sl@0: # define quad_cksum des_quad_cksum sl@0: # define check_parity des_check_key_parity sl@0: #endif sl@0: sl@0: #define des_fixup_key_parity DES_fixup_key_parity sl@0: sl@0: #ifdef __cplusplus sl@0: } sl@0: #endif sl@0: sl@0: /* for DES_read_pw_string et al */ sl@0: #include sl@0: sl@0: #endif