des_old.h

Go to the documentation of this file.
00001 /* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */
00002 
00003 /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
00004  *
00005  * The function names in here are deprecated and are only present to
00006  * provide an interface compatible with openssl 0.9.6 and older as
00007  * well as libdes.  OpenSSL now provides functions where "des_" has
00008  * been replaced with "DES_" in the names, to make it possible to
00009  * make incompatible changes that are needed for C type security and
00010  * other stuff.
00011  *
00012  * This include files has two compatibility modes:
00013  *
00014  *   - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API
00015  *     that is compatible with libdes and SSLeay.
00016  *   - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an
00017  *     API that is compatible with OpenSSL 0.9.5x to 0.9.6x.
00018  *
00019  * Note that these modes break earlier snapshots of OpenSSL, where
00020  * libdes compatibility was the only available mode or (later on) the
00021  * prefered compatibility mode.  However, after much consideration
00022  * (and more or less violent discussions with external parties), it
00023  * was concluded that OpenSSL should be compatible with earlier versions
00024  * of itself before anything else.  Also, in all honesty, libdes is
00025  * an old beast that shouldn't really be used any more.
00026  *
00027  * Please consider starting to use the DES_ functions rather than the
00028  * des_ ones.  The des_ functions will disappear completely before
00029  * OpenSSL 1.0!
00030  *
00031  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
00032  */
00033 
00034 /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
00035  * project 2001.
00036  */
00037 /* ====================================================================
00038  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
00039  *
00040  * Redistribution and use in source and binary forms, with or without
00041  * modification, are permitted provided that the following conditions
00042  * are met:
00043  *
00044  * 1. Redistributions of source code must retain the above copyright
00045  *    notice, this list of conditions and the following disclaimer.
00046  *
00047  * 2. Redistributions in binary form must reproduce the above copyright
00048  *    notice, this list of conditions and the following disclaimer in
00049  *    the documentation and/or other materials provided with the
00050  *    distribution.
00051  *
00052  * 3. All advertising materials mentioning features or use of this
00053  *    software must display the following acknowledgment:
00054  *    "This product includes software developed by the OpenSSL Project
00055  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
00056  *
00057  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
00058  *    endorse or promote products derived from this software without
00059  *    prior written permission. For written permission, please contact
00060  *    openssl-core@openssl.org.
00061  *
00062  * 5. Products derived from this software may not be called "OpenSSL"
00063  *    nor may "OpenSSL" appear in their names without prior written
00064  *    permission of the OpenSSL Project.
00065  *
00066  * 6. Redistributions of any form whatsoever must retain the following
00067  *    acknowledgment:
00068  *    "This product includes software developed by the OpenSSL Project
00069  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
00070  *
00071  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
00072  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00073  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00074  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
00075  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00076  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00077  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00078  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00079  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00080  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00081  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00082  * OF THE POSSIBILITY OF SUCH DAMAGE.
00083  * ====================================================================
00084  *
00085  * This product includes cryptographic software written by Eric Young
00086  * (eay@cryptsoft.com).  This product includes software written by Tim
00087  * Hudson (tjh@cryptsoft.com).
00088  *
00089  */
00090 
00091 #ifndef HEADER_DES_H
00092 #define HEADER_DES_H
00093 
00094 #include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
00095 
00096 #ifdef OPENSSL_NO_DES
00097 #error DES is disabled.
00098 #endif
00099 
00100 #ifndef HEADER_NEW_DES_H
00101 #error You must include des.h, not des_old.h directly.
00102 #endif
00103 
00104 #ifdef _KERBEROS_DES_H
00105 #error <openssl/des_old.h> replaces <kerberos/des.h>.
00106 #endif
00107 
00108 #include <openssl/symhacks.h>
00109 
00110 #ifdef OPENSSL_BUILD_SHLIBCRYPTO
00111 # undef OPENSSL_EXTERN
00112 # define OPENSSL_EXTERN OPENSSL_EXPORT
00113 #endif
00114 
00115 #ifdef  __cplusplus
00116 extern "C" {
00117 #endif
00118 
00119 #ifdef _
00120 #undef _
00121 #endif
00122 
00123 typedef unsigned char _ossl_old_des_cblock[8];
00124 typedef struct _ossl_old_des_ks_struct
00125    {
00126    union {
00127       _ossl_old_des_cblock _;
00128       /* make sure things are correct size on machines with
00129        * 8 byte longs */
00130       DES_LONG pad[2];
00131       } ks;
00132    } _ossl_old_des_key_schedule[16];
00133 
00134 #ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
00135 #define des_cblock DES_cblock
00136 #define const_des_cblock const_DES_cblock
00137 #define des_key_schedule DES_key_schedule
00138 #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
00139    DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
00140 #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
00141    DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
00142 #define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
00143    DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
00144 #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
00145    DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
00146 #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
00147    DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
00148 #define des_options()\
00149    DES_options()
00150 #define des_cbc_cksum(i,o,l,k,iv)\
00151    DES_cbc_cksum((i),(o),(l),&(k),(iv))
00152 #define des_cbc_encrypt(i,o,l,k,iv,e)\
00153    DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
00154 #define des_ncbc_encrypt(i,o,l,k,iv,e)\
00155    DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
00156 #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
00157    DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
00158 #define des_cfb_encrypt(i,o,n,l,k,iv,e)\
00159    DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
00160 #define des_ecb_encrypt(i,o,k,e)\
00161    DES_ecb_encrypt((i),(o),&(k),(e))
00162 #define des_encrypt1(d,k,e)\
00163    DES_encrypt1((d),&(k),(e))
00164 #define des_encrypt2(d,k,e)\
00165    DES_encrypt2((d),&(k),(e))
00166 #define des_encrypt3(d,k1,k2,k3)\
00167    DES_encrypt3((d),&(k1),&(k2),&(k3))
00168 #define des_decrypt3(d,k1,k2,k3)\
00169    DES_decrypt3((d),&(k1),&(k2),&(k3))
00170 #define des_xwhite_in2out(k,i,o)\
00171    DES_xwhite_in2out((k),(i),(o))
00172 #define des_enc_read(f,b,l,k,iv)\
00173    DES_enc_read((f),(b),(l),&(k),(iv))
00174 #define des_enc_write(f,b,l,k,iv)\
00175    DES_enc_write((f),(b),(l),&(k),(iv))
00176 #define des_fcrypt(b,s,r)\
00177    DES_fcrypt((b),(s),(r))
00178 #if 0
00179 #define des_crypt(b,s)\
00180    DES_crypt((b),(s))
00181 #if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
00182 #define crypt(b,s)\
00183    DES_crypt((b),(s))
00184 #endif
00185 #endif
00186 #define des_ofb_encrypt(i,o,n,l,k,iv)\
00187    DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
00188 #define des_pcbc_encrypt(i,o,l,k,iv,e)\
00189    DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
00190 #define des_quad_cksum(i,o,l,c,s)\
00191    DES_quad_cksum((i),(o),(l),(c),(s))
00192 #define des_random_seed(k)\
00193    _ossl_096_des_random_seed((k))
00194 #define des_random_key(r)\
00195    DES_random_key((r))
00196 #define des_read_password(k,p,v) \
00197    DES_read_password((k),(p),(v))
00198 #define des_read_2passwords(k1,k2,p,v) \
00199    DES_read_2passwords((k1),(k2),(p),(v))
00200 #define des_set_odd_parity(k)\
00201    DES_set_odd_parity((k))
00202 #define des_check_key_parity(k)\
00203    DES_check_key_parity((k))
00204 #define des_is_weak_key(k)\
00205    DES_is_weak_key((k))
00206 #define des_set_key(k,ks)\
00207    DES_set_key((k),&(ks))
00208 #define des_key_sched(k,ks)\
00209    DES_key_sched((k),&(ks))
00210 #define des_set_key_checked(k,ks)\
00211    DES_set_key_checked((k),&(ks))
00212 #define des_set_key_unchecked(k,ks)\
00213    DES_set_key_unchecked((k),&(ks))
00214 #define des_string_to_key(s,k)\
00215    DES_string_to_key((s),(k))
00216 #define des_string_to_2keys(s,k1,k2)\
00217    DES_string_to_2keys((s),(k1),(k2))
00218 #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
00219    DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
00220 #define des_ofb64_encrypt(i,o,l,ks,iv,n)\
00221    DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
00222 
00223 
00224 #define des_ecb2_encrypt(i,o,k1,k2,e) \
00225    des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
00226 
00227 #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
00228    des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
00229 
00230 #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
00231    des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
00232 
00233 #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
00234    des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
00235 
00236 #define des_check_key DES_check_key
00237 #define des_rw_mode DES_rw_mode
00238 #else /* libdes compatibility */
00239 /* Map all symbol names to _ossl_old_des_* form, so we avoid all
00240    clashes with libdes */
00241 #define des_cblock _ossl_old_des_cblock
00242 #define des_key_schedule _ossl_old_des_key_schedule
00243 #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
00244    _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
00245 #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
00246    _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
00247 #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
00248    _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
00249 #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
00250    _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
00251 #define des_options()\
00252    _ossl_old_des_options()
00253 #define des_cbc_cksum(i,o,l,k,iv)\
00254    _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
00255 #define des_cbc_encrypt(i,o,l,k,iv,e)\
00256    _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
00257 #define des_ncbc_encrypt(i,o,l,k,iv,e)\
00258    _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
00259 #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
00260    _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
00261 #define des_cfb_encrypt(i,o,n,l,k,iv,e)\
00262    _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
00263 #define des_ecb_encrypt(i,o,k,e)\
00264    _ossl_old_des_ecb_encrypt((i),(o),(k),(e))
00265 #define des_encrypt(d,k,e)\
00266    _ossl_old_des_encrypt((d),(k),(e))
00267 #define des_encrypt2(d,k,e)\
00268    _ossl_old_des_encrypt2((d),(k),(e))
00269 #define des_encrypt3(d,k1,k2,k3)\
00270    _ossl_old_des_encrypt3((d),(k1),(k2),(k3))
00271 #define des_decrypt3(d,k1,k2,k3)\
00272    _ossl_old_des_decrypt3((d),(k1),(k2),(k3))
00273 #define des_xwhite_in2out(k,i,o)\
00274    _ossl_old_des_xwhite_in2out((k),(i),(o))
00275 #define des_enc_read(f,b,l,k,iv)\
00276    _ossl_old_des_enc_read((f),(b),(l),(k),(iv))
00277 #define des_enc_write(f,b,l,k,iv)\
00278    _ossl_old_des_enc_write((f),(b),(l),(k),(iv))
00279 #define des_fcrypt(b,s,r)\
00280    _ossl_old_des_fcrypt((b),(s),(r))
00281 #define des_crypt(b,s)\
00282    _ossl_old_des_crypt((b),(s))
00283 #if 0
00284 #define crypt(b,s)\
00285    _ossl_old_crypt((b),(s))
00286 #endif
00287 #define des_ofb_encrypt(i,o,n,l,k,iv)\
00288    _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
00289 #define des_pcbc_encrypt(i,o,l,k,iv,e)\
00290    _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
00291 #define des_quad_cksum(i,o,l,c,s)\
00292    _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
00293 #define des_random_seed(k)\
00294    _ossl_old_des_random_seed((k))
00295 #define des_random_key(r)\
00296    _ossl_old_des_random_key((r))
00297 #define des_read_password(k,p,v) \
00298    _ossl_old_des_read_password((k),(p),(v))
00299 #define des_read_2passwords(k1,k2,p,v) \
00300    _ossl_old_des_read_2passwords((k1),(k2),(p),(v))
00301 #define des_set_odd_parity(k)\
00302    _ossl_old_des_set_odd_parity((k))
00303 #define des_is_weak_key(k)\
00304    _ossl_old_des_is_weak_key((k))
00305 #define des_set_key(k,ks)\
00306    _ossl_old_des_set_key((k),(ks))
00307 #define des_key_sched(k,ks)\
00308    _ossl_old_des_key_sched((k),(ks))
00309 #define des_string_to_key(s,k)\
00310    _ossl_old_des_string_to_key((s),(k))
00311 #define des_string_to_2keys(s,k1,k2)\
00312    _ossl_old_des_string_to_2keys((s),(k1),(k2))
00313 #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
00314    _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
00315 #define des_ofb64_encrypt(i,o,l,ks,iv,n)\
00316    _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
00317 
00318 
00319 #define des_ecb2_encrypt(i,o,k1,k2,e) \
00320    des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
00321 
00322 #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
00323    des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
00324 
00325 #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
00326    des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
00327 
00328 #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
00329    des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
00330 
00331 #define des_check_key DES_check_key
00332 #define des_rw_mode DES_rw_mode
00333 #endif
00334 
00335 const char *_ossl_old_des_options(void);
00336 void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
00337    _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2,
00338    _ossl_old_des_key_schedule ks3, int enc);
00339 DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
00340    long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
00341 void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
00342    _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
00343 void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
00344    _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
00345 void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
00346    _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,
00347    _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc);
00348 void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits,
00349    long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
00350 void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
00351    _ossl_old_des_key_schedule ks,int enc);
00352 void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
00353 void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
00354 void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
00355    _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
00356 void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
00357    _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
00358 void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output,
00359    long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
00360    _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc);
00361 void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
00362    long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
00363    _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc);
00364 void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
00365    long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
00366    _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num);
00367 
00368 void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white),
00369    _ossl_old_des_cblock (*out_white));
00370 
00371 int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
00372    _ossl_old_des_cblock *iv);
00373 int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
00374    _ossl_old_des_cblock *iv);
00375 char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret);
00376 char *_ossl_old_des_crypt(const char *buf,const char *salt);
00377 #if !defined(PERL5) && !defined(NeXT)
00378 char *_ossl_old_crypt(const char *buf,const char *salt);
00379 #endif
00380 void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out,
00381    int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
00382 void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
00383    _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
00384 DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
00385    long length,int out_count,_ossl_old_des_cblock *seed);
00386 void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
00387 void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
00388 int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify);
00389 int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2,
00390    const char *prompt,int verify);
00391 void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
00392 int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
00393 int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
00394 int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
00395 void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key);
00396 void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2);
00397 void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
00398    _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc);
00399 void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
00400    _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num);
00401 
00402 void _ossl_096_des_random_seed(des_cblock *key);
00403 
00404 /* The following definitions provide compatibility with the MIT Kerberos
00405  * library. The _ossl_old_des_key_schedule structure is not binary compatible. */
00406 
00407 #define _KERBEROS_DES_H
00408 
00409 #define KRBDES_ENCRYPT DES_ENCRYPT
00410 #define KRBDES_DECRYPT DES_DECRYPT
00411 
00412 #ifdef KERBEROS
00413 #  define ENCRYPT DES_ENCRYPT
00414 #  define DECRYPT DES_DECRYPT
00415 #endif
00416 
00417 #ifndef NCOMPAT
00418 #  define C_Block des_cblock
00419 #  define Key_schedule des_key_schedule
00420 #  define KEY_SZ DES_KEY_SZ
00421 #  define string_to_key des_string_to_key
00422 #  define read_pw_string des_read_pw_string
00423 #  define random_key des_random_key
00424 #  define pcbc_encrypt des_pcbc_encrypt
00425 #  define set_key des_set_key
00426 #  define key_sched des_key_sched
00427 #  define ecb_encrypt des_ecb_encrypt
00428 #  define cbc_encrypt des_cbc_encrypt
00429 #  define ncbc_encrypt des_ncbc_encrypt
00430 #  define xcbc_encrypt des_xcbc_encrypt
00431 #  define cbc_cksum des_cbc_cksum
00432 #  define quad_cksum des_quad_cksum
00433 #  define check_parity des_check_key_parity
00434 #endif
00435 
00436 #define des_fixup_key_parity DES_fixup_key_parity
00437 
00438 #ifdef  __cplusplus
00439 }
00440 #endif
00441 
00442 /* for DES_read_pw_string et al */
00443 #include <openssl/ui_compat.h>
00444 
00445 #endif

Generated on Thu Aug 20 22:33:05 2009 for OpenXDAS by  doxygen 1.5.6