00001 #ifndef CRYPTOPP_CONFIG_H
00002 #define CRYPTOPP_CONFIG_H
00003
00004
00005
00006
00007 #if !defined(IS_LITTLE_ENDIAN) && (defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__PPC__) || 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__)
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 typedef unsigned int word32;
00104
00105 #if defined(__GNUC__) || defined(__MWERKS__)
00106 # define WORD64_AVAILABLE
00107 typedef unsigned long long word64;
00108 # define W64LIT(x) x##LL
00109 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00110 # define WORD64_AVAILABLE
00111 typedef unsigned __int64 word64;
00112 # define W64LIT(x) x##ui64
00113 #endif
00114
00115
00116 #if defined(WORD64_AVAILABLE) && !defined(__alpha)
00117 # define SLOW_WORD64
00118 #endif
00119
00120
00121
00122
00123 #if (defined(__GNUC__) && !defined(__alpha)) || defined(__MWERKS__)
00124 typedef unsigned long word;
00125 typedef unsigned long long dword;
00126 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00127 typedef unsigned __int32 word;
00128 typedef unsigned __int64 dword;
00129 #else
00130 typedef unsigned int word;
00131 typedef unsigned long dword;
00132 #endif
00133
00134 const unsigned int WORD_SIZE = sizeof(word);
00135 const unsigned int WORD_BITS = WORD_SIZE * 8;
00136
00137 #define LOW_WORD(x) (word)(x)
00138
00139 union dword_union
00140 {
00141 dword_union (const dword &dw) : dw(dw) {}
00142 dword dw;
00143 word w[2];
00144 };
00145
00146 #ifdef IS_LITTLE_ENDIAN
00147 # define HIGH_WORD(x) (dword_union(x).w[1])
00148 #else
00149 # define HIGH_WORD(x) (dword_union(x).w[0])
00150 #endif
00151
00152
00153
00154
00155
00156 #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00157 # define INTEL_INTRINSICS
00158 # define FAST_ROTATE
00159 #elif defined(__MWERKS__) && TARGET_CPU_PPC
00160 # define PPC_INTRINSICS
00161 # define FAST_ROTATE
00162 #elif defined(__GNUC__) && defined(__i386__)
00163
00164 # define FAST_ROTATE
00165 #endif
00166
00167 NAMESPACE_END
00168
00169
00170 #if defined(_MSC_VER) && (_MSC_VER < 1300)
00171 #define CPP_TYPENAME
00172 #else
00173 #define CPP_TYPENAME typename
00174 #endif
00175
00176 #ifdef _MSC_VER
00177
00178
00179
00180
00181
00182
00183
00184
00185 # pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355)
00186 #endif
00187
00188 #ifdef _MSC_VER
00189
00190 #ifdef CRYPTOPP_EXPORTS
00191 #define CRYPTOPP_IS_DLL
00192 #define CRYPTOPP_DLL __declspec(dllexport)
00193 #elif defined(CRYPTOPP_IMPORTS)
00194 #define CRYPTOPP_IS_DLL
00195 #define CRYPTOPP_DLL __declspec(dllimport)
00196 #else
00197 #define CRYPTOPP_DLL
00198 #endif
00199
00200 #define CRYPTOPP_API __stdcall
00201
00202 #else // _MSC_VER
00203
00204 #define CRYPTOPP_DLL
00205 #define CRYPTOPP_API
00206
00207 #endif // _MSC_VER
00208
00209 #ifdef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
00210 #define CRYPTOPP_MANUAL_EXTERN
00211 #else
00212 #define CRYPTOPP_MANUAL_EXTERN extern
00213 #endif
00214
00215 #define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_MANUAL_EXTERN template class CRYPTOPP_DLL
00216
00217
00218
00219 #ifndef NO_OS_DEPENDENCE
00220
00221 #if defined(_WIN32) || defined(__CYGWIN__)
00222 #define CRYPTOPP_WIN32_AVAILABLE
00223 #endif
00224
00225 #if !defined(NO_OS_DEPENDENCE) && defined(WORD64_AVAILABLE) && (defined(_WIN32) || defined(__unix__) || defined(macintosh))
00226 # define HIGHRES_TIMER_AVAILABLE
00227 #endif
00228
00229 #if defined(__unix__)
00230 # define HAS_BERKELEY_STYLE_SOCKETS
00231 #endif
00232
00233 #ifdef CRYPTOPP_WIN32_AVAILABLE
00234 # define HAS_WINDOWS_STYLE_SOCKETS
00235 #endif
00236
00237 #if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS))
00238 # define SOCKETS_AVAILABLE
00239 #endif
00240
00241 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS))
00242 # define USE_WINDOWS_STYLE_SOCKETS
00243 #else
00244 # define USE_BERKELEY_STYLE_SOCKETS
00245 #endif
00246
00247 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS)
00248 # define WINDOWS_PIPES_AVAILABLE
00249 #endif
00250
00251 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI)
00252 # define NONBLOCKING_RNG_AVAILABLE
00253 # define OS_RNG_AVAILABLE
00254 #endif
00255
00256 #if (defined(__FreeBSD__) || defined(__linux__) || defined(__MACH__))
00257 # define NONBLOCKING_RNG_AVAILABLE
00258 # define BLOCKING_RNG_AVAILABLE
00259 # define OS_RNG_AVAILABLE
00260 #endif
00261
00262 #ifdef __unix__
00263 # define HAS_PTHREADS
00264 # define THREADS_AVAILABLE
00265 #endif
00266
00267 #ifdef CRYPTOPP_WIN32_AVAILABLE
00268 # define HAS_WINTHREADS
00269 # define THREADS_AVAILABLE
00270 #endif
00271
00272 #endif // NO_OS_DEPENDENCE
00273
00274 #endif