Since there has been reports of clashes between OpenSSL's
[openssl.git] / crypto / des / des.h
index ead67986d9ea9d49291f5162b49beb647d02d2a3..96222c30bef63d31d25dfa7c68e7e970646e655a 100644 (file)
 #ifndef HEADER_DES_H
 #define HEADER_DES_H
 
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-#ifdef NO_DES
+#ifdef OPENSSL_NO_DES
 #error DES is disabled.
 #endif
 
@@ -71,10 +67,18 @@ extern "C" {
 #error <openssl/des.h> replaces <kerberos/des.h>.
 #endif
 
-#include <stdio.h>
 #include <openssl/opensslconf.h> /* DES_LONG */
 #include <openssl/e_os2.h>     /* OPENSSL_EXTERN */
 
+#ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+#endif
+
+#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 *
@@ -112,9 +116,10 @@ typedef struct des_ks_struct
 #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
        des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
 
-OPENSSL_EXTERN int des_check_key;      /* defaults to false */
-OPENSSL_EXTERN int des_rw_mode;                /* defaults to DES_PCBC_MODE */
-OPENSSL_EXTERN int des_set_weak_key_flag; /* set the weak key flag */
+OPENSSL_DECLARE_GLOBAL(int,des_check_key);     /* defaults to false */
+#define des_check_key OPENSSL_GLOBAL_REF(des_check_key)
+OPENSSL_DECLARE_GLOBAL(int,des_rw_mode);       /* defaults to DES_PCBC_MODE */
+#define des_rw_mode OPENSSL_GLOBAL_REF(des_rw_mode)
 
 const char *des_options(void);
 void des_ecb3_encrypt(const_des_cblock *input, des_cblock *output,
@@ -148,14 +153,14 @@ void des_ecb_encrypt(const_des_cblock *input,des_cblock *output,
        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);
+void des_encrypt1(DES_LONG *data,des_key_schedule ks, int enc);
 
-/*     This functions is the same as des_encrypt() except that the DES
+/*     This functions is the same as des_encrypt1() 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.
+       out.  As for des_encrypt1(), 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 :-). */
+       as des_encrypt1() des_encrypt1() des_encrypt1() except faster :-). */
 void des_encrypt2(DES_LONG *data,des_key_schedule ks, int enc);
 
 void des_encrypt3(DES_LONG *data, des_key_schedule ks1,