00001 #ifndef CRYPTOPP_CONFIG_H
00002 #define CRYPTOPP_CONFIG_H
00003
00004
00005
00006
00007 #if !defined(IS_LITTLE_ENDIAN) && (defined(__BIG_ENDIAN__) || defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__mips__) || (defined(__MWERKS__) && !defined(__INTEL__)))
00008 # define IS_BIG_ENDIAN
00009 #endif
00010
00011
00012
00013 #ifndef IS_BIG_ENDIAN
00014 # define IS_LITTLE_ENDIAN
00015 #endif
00016
00017
00018
00019
00020
00021
00022
00023
00024 #define USE_MS_CRYPTOAPI
00025
00026
00027 #ifndef DSA_1024_BIT_MODULUS_ONLY
00028 # define DSA_1024_BIT_MODULUS_ONLY 1
00029 #endif
00030
00031
00032
00033
00034
00035
00036 #define GZIP_OS_CODE 0
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #define PREFER_BERKELEY_STYLE_SOCKETS
00053
00054
00055
00056
00057
00058
00059 #ifdef NO_NAMESPACE
00060 # error namespace support is now required
00061 #endif
00062
00063
00064
00065
00066 #define WORKAROUND_MS_BUG_Q258000
00067
00068
00069 #ifdef CRYPTOPP_DOXYGEN_PROCESSING
00070 # define CryptoPP
00071 # define NAMESPACE_BEGIN(x)
00072 # define NAMESPACE_END
00073 #else
00074 # define NAMESPACE_BEGIN(x) namespace x {
00075 # define NAMESPACE_END }
00076 #endif
00077 #define ANONYMOUS_NAMESPACE_BEGIN namespace {
00078 #define USING_NAMESPACE(x) using namespace x;
00079 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
00080 #define DOCUMENTED_NAMESPACE_END }
00081
00082
00083
00084
00085
00086 #ifndef TYPE_OF_SOCKLEN_T
00087 # if defined(_WIN32) || defined(__CYGWIN__) || defined(__MACH__)
00088 # define TYPE_OF_SOCKLEN_T int
00089 # else
00090 # define TYPE_OF_SOCKLEN_T ::socklen_t
00091 # endif
00092 #endif
00093
00094 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
00095 # define __USE_W32_SOCKETS
00096 #endif
00097
00098 typedef unsigned char byte;
00099
00100 NAMESPACE_BEGIN(CryptoPP)
00101
00102 typedef unsigned short word16;
00103 #if defined(__alpha) && !defined(_MSC_VER)
00104 typedef unsigned int word32;
00105 #else
00106 typedef unsigned long word32;
00107 #endif
00108
00109 #if defined(__GNUC__) || defined(__MWERKS__)
00110 # define WORD64_AVAILABLE
00111 typedef unsigned long long word64;
00112 # define W64LIT(x) x##LL
00113 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00114 # define WORD64_AVAILABLE
00115 typedef unsigned __int64 word64;
00116 # define W64LIT(x) x##ui64
00117 #endif
00118
00119
00120 #if defined(WORD64_AVAILABLE) && !defined(__alpha)
00121 # define SLOW_WORD64
00122 #endif
00123
00124
00125
00126
00127 #if (defined(__GNUC__) && !defined(__alpha)) || defined(__MWERKS__)
00128 typedef unsigned long word;
00129 typedef unsigned long long dword;
00130 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00131 typedef unsigned __int32 word;
00132 typedef unsigned __int64 dword;
00133 #else
00134 typedef unsigned int word;
00135 typedef unsigned long dword;
00136 #endif
00137
00138 const unsigned int WORD_SIZE = sizeof(word);
00139 const unsigned int WORD_BITS = WORD_SIZE * 8;
00140
00141 #define LOW_WORD(x) (word)(x)
00142
00143 union dword_union
00144 {
00145 dword_union (const dword &dw) : dw(dw) {}
00146 dword dw;
00147 word w[2];
00148 };
00149
00150 #ifdef IS_LITTLE_ENDIAN
00151 # define HIGH_WORD(x) (dword_union(x).w[1])
00152 #else
00153 # define HIGH_WORD(x) (dword_union(x).w[0])
00154 #endif
00155
00156
00157
00158
00159
00160 #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00161 # define INTEL_INTRINSICS
00162 # define FAST_ROTATE
00163 #elif defined(__MWERKS__) && TARGET_CPU_PPC
00164 # define PPC_INTRINSICS
00165 # define FAST_ROTATE
00166 #elif defined(__GNUC__) && defined(__i386__)
00167
00168 # define FAST_ROTATE
00169 #endif
00170
00171 NAMESPACE_END
00172
00173
00174 #if defined(_MSC_VER) && (_MSC_VER < 1300)
00175 #define CPP_TYPENAME
00176 #else
00177 #define CPP_TYPENAME typename
00178 #endif
00179
00180 #ifdef _MSC_VER
00181
00182
00183
00184
00185
00186 # pragma warning(disable: 4250 4660 4661 4786 4355)
00187 #endif
00188
00189
00190
00191 #ifndef NO_OS_DEPENDENCE
00192
00193 #if defined(_WIN32) || defined(__CYGWIN__)
00194 #define CRYPTOPP_WIN32_AVAILABLE
00195 #endif
00196
00197 #if defined(__unix__) || defined(__MACH__)
00198 #define CRYPTOPP_UNIX_AVAILABLE
00199 #endif
00200
00201 #if defined(WORD64_AVAILABLE) && (defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) || defined(macintosh))
00202 # define HIGHRES_TIMER_AVAILABLE
00203 #endif
00204
00205 #ifdef CRYPTOPP_UNIX_AVAILABLE
00206 # define HAS_BERKELEY_STYLE_SOCKETS
00207 #endif
00208
00209 #ifdef CRYPTOPP_WIN32_AVAILABLE
00210 # define HAS_WINDOWS_STYLE_SOCKETS
00211 #endif
00212
00213 #if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS))
00214 # define SOCKETS_AVAILABLE
00215 #endif
00216
00217 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS))
00218 # define USE_WINDOWS_STYLE_SOCKETS
00219 #else
00220 # define USE_BERKELEY_STYLE_SOCKETS
00221 #endif
00222
00223 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS)
00224 # define WINDOWS_PIPES_AVAILABLE
00225 #endif
00226
00227 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI)
00228 # define NONBLOCKING_RNG_AVAILABLE
00229 # define OS_RNG_AVAILABLE
00230 #endif
00231
00232 #ifdef CRYPTOPP_UNIX_AVAILABLE
00233 # define NONBLOCKING_RNG_AVAILABLE
00234 # define BLOCKING_RNG_AVAILABLE
00235 # define OS_RNG_AVAILABLE
00236 # define HAS_PTHREADS
00237 # define THREADS_AVAILABLE
00238 #endif
00239
00240 #ifdef CRYPTOPP_WIN32_AVAILABLE
00241 # define HAS_WINTHREADS
00242 # define THREADS_AVAILABLE
00243 #endif
00244
00245 #endif // NO_OS_DEPENDENCE
00246
00247 #endif