00001
00002 #ifndef CRYPTOPP_CONFIG_H
00003 #define CRYPTOPP_CONFIG_H
00004
00005
00006
00007
00008
00009 #define IS_LITTLE_ENDIAN
00010
00011
00012
00013
00014
00015
00016
00017
00018 #define USE_MS_CRYPTOAPI
00019
00020
00021 #ifndef DSA_1024_BIT_MODULUS_ONLY
00022 # define DSA_1024_BIT_MODULUS_ONLY 1
00023 #endif
00024
00025
00026
00027
00028
00029
00030 #define GZIP_OS_CODE 0
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #define PREFER_BERKELEY_STYLE_SOCKETS
00043
00044
00045
00046
00047
00048
00049 #ifdef NO_NAMESPACE
00050 # error namespace support is now required
00051 #endif
00052
00053
00054
00055
00056 #define WORKAROUND_MS_BUG_Q258000
00057
00058 #ifdef CRYPTOPP_DOXYGEN_PROCESSING
00059
00060 # define CryptoPP
00061 # define NAMESPACE_BEGIN(x)
00062 # define NAMESPACE_END
00063
00064 # define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
00065 #else
00066 # define NAMESPACE_BEGIN(x) namespace x {
00067 # define NAMESPACE_END }
00068 # define DOCUMENTED_TYPEDEF(x, y) typedef x y;
00069 #endif
00070 #define ANONYMOUS_NAMESPACE_BEGIN namespace {
00071 #define USING_NAMESPACE(x) using namespace x;
00072 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
00073 #define DOCUMENTED_NAMESPACE_END }
00074
00075
00076
00077
00078
00079 #ifndef TYPE_OF_SOCKLEN_T
00080 # if defined(_WIN32) || defined(__CYGWIN__) || defined(__MACH__)
00081 # define TYPE_OF_SOCKLEN_T int
00082 # else
00083 # define TYPE_OF_SOCKLEN_T ::socklen_t
00084 # endif
00085 #endif
00086
00087 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
00088 # define __USE_W32_SOCKETS
00089 #endif
00090
00091 typedef unsigned char byte;
00092
00093 NAMESPACE_BEGIN(CryptoPP)
00094
00095 typedef unsigned short word16;
00096 typedef unsigned int word32;
00097
00098 #if defined(__GNUC__) || defined(__MWERKS__)
00099 #define WORD64_AVAILABLE
00100 typedef unsigned long long word64;
00101 #define W64LIT(x) x##LL
00102 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00103 #define WORD64_AVAILABLE
00104 typedef unsigned __int64 word64;
00105 #define W64LIT(x) x##ui64
00106 #endif
00107
00108
00109 #ifdef WORD64_AVAILABLE
00110 typedef word64 lword;
00111 #else
00112 typedef word32 lword;
00113 #endif
00114
00115 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64)
00116
00117
00118
00119
00120 typedef word32 hword;
00121 typedef word64 word;
00122 #else
00123 #define CRYPTOPP_NATIVE_DWORD_AVAILABLE
00124 #ifdef WORD64_AVAILABLE
00125 #define CRYPTOPP_SLOW_WORD64
00126 typedef word16 hword;
00127 typedef word32 word;
00128 typedef word64 dword;
00129 #else
00130 typedef word8 hword;
00131 typedef word16 word;
00132 typedef word32 dword;
00133 #endif
00134 #endif
00135
00136 const unsigned int WORD_SIZE = sizeof(word);
00137 const unsigned int WORD_BITS = WORD_SIZE * 8;
00138
00139 #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00140 #define INTEL_INTRINSICS
00141 #define FAST_ROTATE
00142 #elif defined(__MWERKS__) && TARGET_CPU_PPC
00143 #define PPC_INTRINSICS
00144 #define FAST_ROTATE
00145 #elif defined(__GNUC__) && defined(__i386__)
00146
00147 #define FAST_ROTATE
00148 #endif
00149
00150 NAMESPACE_END
00151
00152
00153 #if defined(_MSC_VER) && (_MSC_VER < 1300)
00154 #define CPP_TYPENAME
00155 #else
00156 #define CPP_TYPENAME typename
00157 #endif
00158
00159 #ifdef _MSC_VER
00160 #define CRYPTOPP_NO_VTABLE __declspec(novtable)
00161 #else
00162 #define CRYPTOPP_NO_VTABLE
00163 #endif
00164
00165 #ifdef _MSC_VER
00166
00167
00168
00169
00170
00171
00172
00173
00174 # pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355)
00175 #endif
00176
00177 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION)
00178 #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
00179 #endif
00180
00181 #ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
00182 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
00183 #endif
00184
00185
00186 #if !defined(CRYPTOPP_DISABLE_X86ASM) && ((defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86)) || (defined(__GNUC__) && defined(__i386__)))
00187 #define CRYPTOPP_X86ASM_AVAILABLE
00188 #endif
00189
00190
00191
00192 #ifndef NO_OS_DEPENDENCE
00193
00194 #if defined(_WIN32) || defined(__CYGWIN__)
00195 #define CRYPTOPP_WIN32_AVAILABLE
00196 #endif
00197
00198 #if defined(__unix__) || defined(__MACH__)
00199 #define CRYPTOPP_UNIX_AVAILABLE
00200 #endif
00201
00202 #if defined(WORD64_AVAILABLE) && (defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))
00203 # define HIGHRES_TIMER_AVAILABLE
00204 #endif
00205
00206 #ifdef CRYPTOPP_UNIX_AVAILABLE
00207 # define HAS_BERKELEY_STYLE_SOCKETS
00208 #endif
00209
00210 #ifdef CRYPTOPP_WIN32_AVAILABLE
00211 # define HAS_WINDOWS_STYLE_SOCKETS
00212 #endif
00213
00214 #if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS))
00215 # define SOCKETS_AVAILABLE
00216 #endif
00217
00218 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS))
00219 # define USE_WINDOWS_STYLE_SOCKETS
00220 #else
00221 # define USE_BERKELEY_STYLE_SOCKETS
00222 #endif
00223
00224 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS)
00225 # define WINDOWS_PIPES_AVAILABLE
00226 #endif
00227
00228 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI)
00229 # define NONBLOCKING_RNG_AVAILABLE
00230 # define OS_RNG_AVAILABLE
00231 #endif
00232
00233 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
00234 # define NONBLOCKING_RNG_AVAILABLE
00235 # define BLOCKING_RNG_AVAILABLE
00236 # define OS_RNG_AVAILABLE
00237 # define HAS_PTHREADS
00238 # define THREADS_AVAILABLE
00239 #endif
00240
00241 #ifdef CRYPTOPP_WIN32_AVAILABLE
00242 # define HAS_WINTHREADS
00243 # define THREADS_AVAILABLE
00244 #endif
00245
00246 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
00247 # define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
00248 #endif
00249
00250 #if defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
00251 # define CRYPTOPP_MEMALIGN_AVAILABLE
00252 #endif
00253
00254 #endif
00255
00256
00257
00258 #ifdef CRYPTOPP_WIN32_AVAILABLE
00259
00260 #ifdef CRYPTOPP_EXPORTS
00261 #define CRYPTOPP_IS_DLL
00262 #define CRYPTOPP_DLL __declspec(dllexport)
00263 #elif defined(CRYPTOPP_IMPORTS)
00264 #define CRYPTOPP_IS_DLL
00265 #define CRYPTOPP_DLL __declspec(dllimport)
00266 #else
00267 #define CRYPTOPP_DLL
00268 #endif
00269
00270 #define CRYPTOPP_API __stdcall
00271 #define CRYPTOPP_CDECL __cdecl
00272
00273 #else
00274
00275 #define CRYPTOPP_DLL
00276 #define CRYPTOPP_API
00277 #define CRYPTOPP_CDECL
00278
00279 #endif
00280
00281 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
00282 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
00283 #elif defined(__MWERKS__)
00284 #define CRYPTOPP_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
00285 #else
00286 #define CRYPTOPP_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
00287 #endif
00288
00289 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
00290 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
00291 #elif defined(__MWERKS__)
00292 #define CRYPTOPP_STATIC_TEMPLATE_CLASS extern class
00293 #else
00294 #define CRYPTOPP_STATIC_TEMPLATE_CLASS extern template class
00295 #endif
00296
00297 #endif