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 #define PREFER_BERKELEY_STYLE_SOCKETS
00049
00050
00051
00052
00053
00054
00055 #ifdef NO_NAMESPACE
00056 # error namespace support is now required
00057 #endif
00058
00059
00060
00061
00062 #define WORKAROUND_MS_BUG_Q258000
00063
00064
00065 #ifdef CRYPTOPP_DOXYGEN_PROCESSING
00066 # define CryptoPP
00067 # define NAMESPACE_BEGIN(x)
00068 # define NAMESPACE_END
00069 #else
00070 # define NAMESPACE_BEGIN(x) namespace x {
00071 # define NAMESPACE_END }
00072 #endif
00073 #define ANONYMOUS_NAMESPACE_BEGIN namespace {
00074 #define USING_NAMESPACE(x) using namespace x;
00075 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
00076 #define DOCUMENTED_NAMESPACE_END }
00077
00078
00079
00080
00081
00082 #ifndef TYPE_OF_SOCKLEN_T
00083 # if defined(_WIN32) || defined(__CYGWIN__) || defined(__MACH__)
00084 # define TYPE_OF_SOCKLEN_T int
00085 # else
00086 # define TYPE_OF_SOCKLEN_T ::socklen_t
00087 # endif
00088 #endif
00089
00090 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
00091 # define __USE_W32_SOCKETS
00092 #endif
00093
00094 typedef unsigned char byte;
00095
00096 NAMESPACE_BEGIN(CryptoPP)
00097
00098 typedef unsigned short word16;
00099 typedef unsigned int word32;
00100
00101 #if defined(__GNUC__) || defined(__MWERKS__)
00102 #define WORD64_AVAILABLE
00103 typedef unsigned long long word64;
00104 #define W64LIT(x) x##LL
00105 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00106 #define WORD64_AVAILABLE
00107 typedef unsigned __int64 word64;
00108 #define W64LIT(x) x##ui64
00109 #endif
00110
00111
00112 #ifdef WORD64_AVAILABLE
00113 typedef word64 lword;
00114 #else
00115 typedef word32 lword;
00116 #endif
00117
00118 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64)
00119
00120
00121
00122
00123 typedef word32 hword;
00124 typedef word64 word;
00125 #else
00126 #define CRYPTOPP_NATIVE_DWORD_AVAILABLE
00127 #ifdef WORD64_AVAILABLE
00128 #define CRYPTOPP_SLOW_WORD64 // defined this if your CPU is not 64-bit to use alternative code that avoids word64
00129 typedef word16 hword;
00130 typedef word32 word;
00131 typedef word64 dword;
00132 #else
00133 typedef word8 hword;
00134 typedef word16 word;
00135 typedef word32 dword;
00136 #endif
00137 #endif
00138
00139 const unsigned int WORD_SIZE = sizeof(word);
00140 const unsigned int WORD_BITS = WORD_SIZE * 8;
00141
00142 #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00143 #define INTEL_INTRINSICS
00144 #define FAST_ROTATE
00145 #elif defined(__MWERKS__) && TARGET_CPU_PPC
00146 #define PPC_INTRINSICS
00147 #define FAST_ROTATE
00148 #elif defined(__GNUC__) && defined(__i386__)
00149
00150 #define FAST_ROTATE
00151 #endif
00152
00153 NAMESPACE_END
00154
00155
00156 #if defined(_MSC_VER) && (_MSC_VER < 1300)
00157 #define CPP_TYPENAME
00158 #else
00159 #define CPP_TYPENAME typename
00160 #endif
00161
00162 #ifdef _MSC_VER
00163 #define CRYPTOPP_NO_VTABLE __declspec(novtable)
00164 #else
00165 #define CRYPTOPP_NO_VTABLE
00166 #endif
00167
00168 #ifdef _MSC_VER
00169
00170
00171
00172
00173
00174
00175
00176
00177 # pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355)
00178 #endif
00179
00180 #if !(defined(_MSC_VER) && _MSC_VER <= 1300) && !defined(__MWERKS__)
00181 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
00182 #endif
00183
00184
00185 #if !defined(CRYPTOPP_DISABLE_X86ASM) && ((defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86)) || (defined(__GNUC__) && defined(__i386__)))
00186 #define CRYPTOPP_X86ASM_AVAILABLE
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))
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
00248
00249 #ifdef CRYPTOPP_WIN32_AVAILABLE
00250
00251 #ifdef CRYPTOPP_EXPORTS
00252 #define CRYPTOPP_IS_DLL
00253 #define CRYPTOPP_DLL __declspec(dllexport)
00254 #elif defined(CRYPTOPP_IMPORTS)
00255 #define CRYPTOPP_IS_DLL
00256 #define CRYPTOPP_DLL __declspec(dllimport)
00257 #else
00258 #define CRYPTOPP_DLL
00259 #endif
00260
00261 #define CRYPTOPP_API __stdcall
00262 #define CRYPTOPP_CDECL __cdecl
00263
00264 #else // CRYPTOPP_WIN32_AVAILABLE
00265
00266 #define CRYPTOPP_DLL
00267 #define CRYPTOPP_API
00268 #define CRYPTOPP_CDECL
00269
00270 #endif // CRYPTOPP_WIN32_AVAILABLE
00271
00272 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
00273 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
00274 #elif defined(__MWERKS__)
00275 #define CRYPTOPP_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
00276 #else
00277 #define CRYPTOPP_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
00278 #endif
00279
00280 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
00281 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
00282 #elif defined(__MWERKS__)
00283 #define CRYPTOPP_STATIC_TEMPLATE_CLASS extern class
00284 #else
00285 #define CRYPTOPP_STATIC_TEMPLATE_CLASS extern template class
00286 #endif
00287
00288 #endif