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 ([email protected]) 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  *    [email protected]
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  * ([email protected]).  This product includes software written by Tim
00087  * Hudson ([email protected]).
00088  *
00089  */
00090 /*
00091  © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
00092  */
00093 
00094 #ifndef HEADER_DES_H
00095 #define HEADER_DES_H
00096 
00097 #if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
00098 #define SYMBIAN
00099 #endif
00100 
00101 #ifdef SYMBIAN
00102 #include <e32def.h>
00103 #endif
00104 #include <openssl/e_os2.h>      /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
00105 
00106 #ifdef OPENSSL_NO_DES
00107 #error DES is disabled.
00108 #endif
00109 
00110 #ifndef HEADER_NEW_DES_H
00111 #error You must include des.h, not des_old.h directly.
00112 #endif
00113 
00114 #ifdef _KERBEROS_DES_H
00115 #error <openssl/des_old.h> replaces <kerberos/des.h>.
00116 #endif
00117 
00118 #include <openssl/symhacks.h>
00119 
00120 #ifdef OPENSSL_BUILD_SHLIBCRYPTO
00121 # undef OPENSSL_EXTERN
00122 # define OPENSSL_EXTERN OPENSSL_EXPORT
00123 #endif
00124 
00125 #ifdef  __cplusplus
00126 extern "C" {
00127 #endif
00128 
00129 #ifdef _
00130 #undef _
00131 #endif
00132 
00133 typedef unsigned char _ossl_old_des_cblock[8];
00134 typedef struct _ossl_old_des_ks_struct
00135         {
00136         union   {
00137                 _ossl_old_des_cblock _;
00138                 /* make sure things are correct size on machines with
00139                  * 8 byte longs */
00140                 DES_LONG pad[2];
00141                 } ks;
00142         } _ossl_old_des_key_schedule[16];
00143 
00144 #ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
00145 #define des_cblock DES_cblock
00146 #define const_des_cblock const_DES_cblock
00147 #define des_key_schedule DES_key_schedule
00148 #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
00149         DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
00150 #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
00151         DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
00152 #define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
00153         DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
00154 #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
00155         DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
00156 #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
00157         DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
00158 #define des_options()\
00159         DES_options()
00160 #define des_cbc_cksum(i,o,l,k,iv)\
00161         DES_cbc_cksum((i),(o),(l),&(k),(iv))
00162 #define des_cbc_encrypt(i,o,l,k,iv,e)\
00163         DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
00164 #define des_ncbc_encrypt(i,o,l,k,iv,e)\
00165         DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
00166 #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
00167         DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
00168 #define des_cfb_encrypt(i,o,n,l,k,iv,e)\
00169         DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
00170 #define des_ecb_encrypt(i,o,k,e)\
00171         DES_ecb_encrypt((i),(o),&(k),(e))
00172 #define des_encrypt1(d,k,e)\
00173         DES_encrypt1((d),&(k),(e))
00174 #define des_encrypt2(d,k,e)\
00175         DES_encrypt2((d),&(k),(e))
00176 #define des_encrypt3(d,k1,k2,k3)\
00177         DES_encrypt3((d),&(k1),&(k2),&(k3))
00178 #define des_decrypt3(d,k1,k2,k3)\
00179         DES_decrypt3((d),&(k1),&(k2),&(k3))
00180 #define des_xwhite_in2out(k,i,o)\
00181         DES_xwhite_in2out((k),(i),(o))
00182 #define des_enc_read(f,b,l,k,iv)\
00183         DES_enc_read((f),(b),(l),&(k),(iv))
00184 #define des_enc_write(f,b,l,k,iv)\
00185         DES_enc_write((f),(b),(l),&(k),(iv))
00186 #define des_fcrypt(b,s,r)\
00187         DES_fcrypt((b),(s),(r))
00188 #if 0
00189 #define des_crypt(b,s)\
00190         DES_crypt((b),(s))
00191 #if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
00192 #define crypt(b,s)\
00193         DES_crypt((b),(s))
00194 #endif
00195 #endif
00196 #define des_ofb_encrypt(i,o,n,l,k,iv)\
00197         DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
00198 #define des_pcbc_encrypt(i,o,l,k,iv,e)\
00199         DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
00200 #define des_quad_cksum(i,o,l,c,s)\
00201         DES_quad_cksum((i),(o),(l),(c),(s))
00202 #define des_random_seed(k)\
00203         _ossl_096_des_random_seed((k))
00204 #define des_random_key(r)\
00205         DES_random_key((r))
00206 #define des_read_password(k,p,v) \
00207         DES_read_password((k),(p),(v))
00208 #define des_read_2passwords(k1,k2,p,v) \
00209         DES_read_2passwords((k1),(k2),(p),(v))
00210 #define des_set_odd_parity(k)\
00211         DES_set_odd_parity((k))
00212 #define des_check_key_parity(k)\
00213         DES_check_key_parity((k))
00214 #define des_is_weak_key(k)\
00215         DES_is_weak_key((k))
00216 #define des_set_key(k,ks)\
00217         DES_set_key((k),&(ks))
00218 #define des_key_sched(k,ks)\
00219         DES_key_sched((k),&(ks))
00220 #define des_set_key_checked(k,ks)\
00221         DES_set_key_checked((k),&(ks))
00222 #define des_set_key_unchecked(k,ks)\
00223         DES_set_key_unchecked((k),&(ks))
00224 #define des_string_to_key(s,k)\
00225         DES_string_to_key((s),(k))
00226 #define des_string_to_2keys(s,k1,k2)\
00227         DES_string_to_2keys((s),(k1),(k2))
00228 #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
00229         DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
00230 #define des_ofb64_encrypt(i,o,l,ks,iv,n)\
00231         DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
00232                 
00233 
00234 #define des_ecb2_encrypt(i,o,k1,k2,e) \
00235         des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
00236 
00237 #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
00238         des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
00239 
00240 #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
00241         des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
00242 
00243 #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
00244         des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
00245 
00246 #define des_check_key DES_check_key
00247 #define des_rw_mode DES_rw_mode
00248 #else /* libdes compatibility */
00249 /* Map all symbol names to _ossl_old_des_* form, so we avoid all
00250    clashes with libdes */
00251 #define des_cblock _ossl_old_des_cblock
00252 #define des_key_schedule _ossl_old_des_key_schedule
00253 #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
00254         _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
00255 #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
00256         _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
00257 #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
00258         _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
00259 #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
00260         _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
00261 #define des_options()\
00262         _ossl_old_des_options()
00263 #define des_cbc_cksum(i,o,l,k,iv)\
00264         _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
00265 #define des_cbc_encrypt(i,o,l,k,iv,e)\
00266         _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
00267 #define des_ncbc_encrypt(i,o,l,k,iv,e)\
00268         _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
00269 #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
00270         _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
00271 #define des_cfb_encrypt(i,o,n,l,k,iv,e)\
00272         _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
00273 #define des_ecb_encrypt(i,o,k,e)\
00274         _ossl_old_des_ecb_encrypt((i),(o),(k),(e))
00275 #define des_encrypt(d,k,e)\
00276         _ossl_old_des_encrypt((d),(k),(e))
00277 #define des_encrypt2(d,k,e)\
00278         _ossl_old_des_encrypt2((d),(k),(e))
00279 #define des_encrypt3(d,k1,k2,k3)\
00280         _ossl_old_des_encrypt3((d),(k1),(k2),(k3))
00281 #define des_decrypt3(d,k1,k2,k3)\
00282         _ossl_old_des_decrypt3((d),(k1),(k2),(k3))
00283 #define des_xwhite_in2out(k,i,o)\
00284         _ossl_old_des_xwhite_in2out((k),(i),(o))
00285 #define des_enc_read(f,b,l,k,iv)\
00286         _ossl_old_des_enc_read((f),(b),(l),(k),(iv))
00287 #define des_enc_write(f,b,l,k,iv)\
00288         _ossl_old_des_enc_write((f),(b),(l),(k),(iv))
00289 #define des_fcrypt(b,s,r)\
00290         _ossl_old_des_fcrypt((b),(s),(r))
00291 #define des_crypt(b,s)\
00292         _ossl_old_des_crypt((b),(s))
00293 #if 0
00294 #define crypt(b,s)\
00295         _ossl_old_crypt((b),(s))
00296 #endif
00297 #define des_ofb_encrypt(i,o,n,l,k,iv)\
00298         _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
00299 #define des_pcbc_encrypt(i,o,l,k,iv,e)\
00300         _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
00301 #define des_quad_cksum(i,o,l,c,s)\
00302         _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
00303 #define des_random_seed(k)\
00304         _ossl_old_des_random_seed((k))
00305 #define des_random_key(r)\
00306         _ossl_old_des_random_key((r))
00307 #define des_read_password(k,p,v) \
00308         _ossl_old_des_read_password((k),(p),(v))
00309 #define des_read_2passwords(k1,k2,p,v) \
00310         _ossl_old_des_read_2passwords((k1),(k2),(p),(v))
00311 #define des_set_odd_parity(k)\
00312         _ossl_old_des_set_odd_parity((k))
00313 #define des_is_weak_key(k)\
00314         _ossl_old_des_is_weak_key((k))
00315 #define des_set_key(k,ks)\
00316         _ossl_old_des_set_key((k),(ks))
00317 #define des_key_sched(k,ks)\
00318         _ossl_old_des_key_sched((k),(ks))
00319 #define des_string_to_key(s,k)\
00320         _ossl_old_des_string_to_key((s),(k))
00321 #define des_string_to_2keys(s,k1,k2)\
00322         _ossl_old_des_string_to_2keys((s),(k1),(k2))
00323 #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
00324         _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
00325 #define des_ofb64_encrypt(i,o,l,ks,iv,n)\
00326         _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
00327                 
00328 
00329 #define des_ecb2_encrypt(i,o,k1,k2,e) \
00330         des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
00331 
00332 #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
00333         des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
00334 
00335 #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
00336         des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
00337 
00338 #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
00339         des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
00340 
00341 #define des_check_key DES_check_key
00342 #define des_rw_mode DES_rw_mode
00343 #endif
00344 
00345 IMPORT_C const char *_ossl_old_des_options(void);
00346 IMPORT_C void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
00347         _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2,
00348         _ossl_old_des_key_schedule ks3, int enc);
00349 IMPORT_C DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
00350         long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
00351 IMPORT_C void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
00352         _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
00353 IMPORT_C void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
00354         _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
00355 IMPORT_C void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
00356         _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,
00357         _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc);
00358 IMPORT_C void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits,
00359         long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
00360 IMPORT_C void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
00361         _ossl_old_des_key_schedule ks,int enc);
00362 IMPORT_C void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
00363 IMPORT_C void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
00364 IMPORT_C void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
00365         _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
00366 IMPORT_C void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
00367         _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
00368 IMPORT_C void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output, 
00369         long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, 
00370         _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc);
00371 IMPORT_C void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
00372         long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
00373         _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc);
00374 IMPORT_C void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
00375         long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
00376         _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num);
00377 
00378 IMPORT_C void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white),
00379         _ossl_old_des_cblock (*out_white));
00380 
00381 IMPORT_C int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
00382         _ossl_old_des_cblock *iv);
00383 IMPORT_C int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
00384         _ossl_old_des_cblock *iv);
00385 IMPORT_C char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret);
00386 IMPORT_C char *_ossl_old_des_crypt(const char *buf,const char *salt);
00387 #if !defined(PERL5) && !defined(NeXT)
00388 IMPORT_C char *_ossl_old_crypt(const char *buf,const char *salt);
00389 #endif
00390 IMPORT_C void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out,
00391         int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
00392 IMPORT_C void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
00393         _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
00394 IMPORT_C DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
00395         long length,int out_count,_ossl_old_des_cblock *seed);
00396 IMPORT_C void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
00397 IMPORT_C void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
00398 IMPORT_C int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify);
00399 IMPORT_C int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2,
00400         const char *prompt,int verify);
00401 IMPORT_C void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
00402 IMPORT_C int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
00403 IMPORT_C int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
00404 IMPORT_C int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
00405 IMPORT_C void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key);
00406 IMPORT_C void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2);
00407 IMPORT_C void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
00408         _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc);
00409 IMPORT_C void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
00410         _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num);
00411 
00412 IMPORT_C void _ossl_096_des_random_seed(des_cblock *key);
00413 
00414 /* The following definitions provide compatibility with the MIT Kerberos
00415  * library. The _ossl_old_des_key_schedule structure is not binary compatible. */
00416 
00417 #define _KERBEROS_DES_H
00418 
00419 #define KRBDES_ENCRYPT DES_ENCRYPT
00420 #define KRBDES_DECRYPT DES_DECRYPT
00421 
00422 #ifdef KERBEROS
00423 #  define ENCRYPT DES_ENCRYPT
00424 #  define DECRYPT DES_DECRYPT
00425 #endif
00426 
00427 #ifndef NCOMPAT
00428 #  define C_Block des_cblock
00429 #  define Key_schedule des_key_schedule
00430 #  define KEY_SZ DES_KEY_SZ
00431 #  define string_to_key des_string_to_key
00432 #  define read_pw_string des_read_pw_string
00433 #  define random_key des_random_key
00434 #  define pcbc_encrypt des_pcbc_encrypt
00435 #  define set_key des_set_key
00436 #  define key_sched des_key_sched
00437 #  define ecb_encrypt des_ecb_encrypt
00438 #  define cbc_encrypt des_cbc_encrypt
00439 #  define ncbc_encrypt des_ncbc_encrypt
00440 #  define xcbc_encrypt des_xcbc_encrypt
00441 #  define cbc_cksum des_cbc_cksum
00442 #  define quad_cksum des_quad_cksum
00443 #  define check_parity des_check_key_parity
00444 #endif
00445 
00446 #define des_fixup_key_parity DES_fixup_key_parity
00447 
00448 #ifdef  __cplusplus
00449 }
00450 #endif
00451 
00452 /* for DES_read_pw_string et al */
00453 #include <openssl/ui_compat.h>
00454 
00455 #endif

Copyright © Nokia Corporation 2001-2008
Back to top