diff options
Diffstat (limited to 'crypto/des/des.h')
| -rw-r--r-- | crypto/des/des.h | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/crypto/des/des.h b/crypto/des/des.h index cf536e64289..98a9c4127c8 100644 --- a/crypto/des/des.h +++ b/crypto/des/des.h @@ -59,6 +59,10 @@ #ifndef HEADER_DES_H #define HEADER_DES_H +#ifdef __cplusplus +extern "C" { +#endif + #ifdef NO_DES #error DES is disabled. #endif @@ -71,14 +75,13 @@ #include <openssl/opensslconf.h> /* DES_LONG */ #include <openssl/e_os2.h> /* OPENSSL_EXTERN */ -#ifdef __cplusplus -extern "C" { -#endif - typedef unsigned char des_cblock[8]; typedef /* const */ unsigned char const_des_cblock[8]; /* With "const", gcc 2.8.1 on Solaris thinks that des_cblock * - * and const_des_cblock * are incompatible pointer types. */ + * and const_des_cblock * are incompatible pointer types. + * I haven't seen that warning on other systems ... I'll look + * what the standard says. */ + typedef struct des_ks_struct { @@ -138,26 +141,8 @@ void des_cfb_encrypt(const unsigned char *in,unsigned char *out,int numbits, int enc); void des_ecb_encrypt(const_des_cblock *input,des_cblock *output, des_key_schedule ks,int enc); - -/* This is the DES encryption function that gets called by just about - every other DES routine in the library. You should not use this - function except to implement 'modes' of DES. I say this because the - functions that call this routine do the conversion from 'char *' to - long, and this needs to be done to make sure 'non-aligned' memory - access do not occur. The characters are loaded 'little endian'. - Data is a pointer to 2 unsigned long's and ks is the - des_key_schedule to use. enc, is non zero specifies encryption, - zero if decryption. */ void des_encrypt(DES_LONG *data,des_key_schedule ks, int enc); - -/* This functions is the same as des_encrypt() except that the DES - initial permutation (IP) and final permutation (FP) have been left - out. As for des_encrypt(), you should not use this function. - It is used by the routines in the library that implement triple DES. - IP() des_encrypt2() des_encrypt2() des_encrypt2() FP() is the same - as des_encrypt() des_encrypt() des_encrypt() except faster :-). */ void des_encrypt2(DES_LONG *data,des_key_schedule ks, int enc); - void des_encrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2, des_key_schedule ks3); void des_decrypt3(DES_LONG *data, des_key_schedule ks1, @@ -207,7 +192,6 @@ int des_read_2passwords(des_cblock *key1,des_cblock *key2, const char *prompt,int verify); int des_read_pw_string(char *buf,int length,const char *prompt,int verify); void des_set_odd_parity(des_cblock *key); -int des_check_key_parity(const_des_cblock *key); int des_is_weak_key(const_des_cblock *key); /* des_set_key (= set_key = des_key_sched = key_sched) calls * des_set_key_checked if global variable des_check_key is set, @@ -225,6 +209,9 @@ void des_ofb64_encrypt(const unsigned char *in,unsigned char *out,long length, des_key_schedule schedule,des_cblock *ivec,int *num); int des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); +/* Extra functions from Mark Murray <[email protected]> */ +void des_cblock_print_file(const_des_cblock *cb, FILE *fp); + /* The following definitions provide compatibility with the MIT Kerberos * library. The des_key_schedule structure is not binary compatible. */ @@ -254,11 +241,11 @@ int des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); # define xcbc_encrypt des_xcbc_encrypt # define cbc_cksum des_cbc_cksum # define quad_cksum des_quad_cksum -# define check_parity des_check_key_parity #endif typedef des_key_schedule bit_64; #define des_fixup_key_parity des_set_odd_parity +#define des_check_key_parity check_parity #ifdef __cplusplus } |
