2 #define CRYPTOPP_DISABLE_SSE2
5 #ifndef CRYPTOPP_CONFIG_H
6 #define CRYPTOPP_CONFIG_H
11 #if !defined(IS_LITTLE_ENDIAN) && (defined(__BIG_ENDIAN__) || defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__MIPSEB__) || defined(__s390__) || defined(__ARMEB__) || (defined(__MWERKS__) && !defined(__INTEL__)))
12 # define IS_BIG_ENDIAN
18 # define IS_LITTLE_ENDIAN
28 #define USE_MS_CRYPTOAPI
35 #define GZIP_OS_CODE 0
47 #define PREFER_BERKELEY_STYLE_SOCKETS
51 #define CRYPTOPP_RIJNDAEL_NAME "AES"
58 # error namespace support is now required
64 #define WORKAROUND_MS_BUG_Q258000
66 #ifdef CRYPTOPP_DOXYGEN_PROCESSING
69 # define NAMESPACE_BEGIN(x)
70 # define NAMESPACE_END
72 # define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
74 # define NAMESPACE_BEGIN(x) namespace x {
75 # define NAMESPACE_END }
76 # define DOCUMENTED_TYPEDEF(x, y) typedef x y;
78 #define ANONYMOUS_NAMESPACE_BEGIN namespace {
79 #define USING_NAMESPACE(x) using namespace x;
80 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
81 #define DOCUMENTED_NAMESPACE_END }
87 #ifndef TYPE_OF_SOCKLEN_T
88 # if defined(_WIN32) || defined(__CYGWIN__)
89 # define TYPE_OF_SOCKLEN_T int
91 # define TYPE_OF_SOCKLEN_T ::socklen_t
95 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
96 # define __USE_W32_SOCKETS
99 typedef unsigned char byte;
101 NAMESPACE_BEGIN(CryptoPP)
103 typedef
unsigned short word16;
104 typedef
unsigned int word32;
106 #if defined(_MSC_VER) || defined(__BORLANDC__)
107 typedef unsigned __int64 word64;
108 #define W64LIT(x) x##ui64
110 typedef unsigned long long word64;
111 #define W64LIT(x) x##ULL
115 typedef word64 lword;
116 const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
119 #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
124 #if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && defined(__x86_64__)) || (defined(__SUNPRO_CC) && defined(__x86_64__))
125 typedef word32 hword;
128 #define CRYPTOPP_NATIVE_DWORD_AVAILABLE
129 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) || defined(__s390x__)
130 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && CRYPTOPP_GCC_VERSION >= 30400
133 typedef word32 hword;
135 typedef __uint128_t dword;
136 typedef __uint128_t word128;
137 #define CRYPTOPP_WORD128_AVAILABLE
140 typedef word16 hword;
142 typedef word64 dword;
146 #define CRYPTOPP_BOOL_SLOW_WORD64 1
147 typedef word16 hword;
149 typedef word64 dword;
152 #ifndef CRYPTOPP_BOOL_SLOW_WORD64
153 #define CRYPTOPP_BOOL_SLOW_WORD64 0
156 const unsigned int WORD_SIZE =
sizeof(word);
157 const unsigned int WORD_BITS = WORD_SIZE * 8;
161 #ifndef CRYPTOPP_L1_CACHE_LINE_SIZE
163 #if defined(_M_X64) || defined(__x86_64__)
164 #define CRYPTOPP_L1_CACHE_LINE_SIZE 64
167 #define CRYPTOPP_L1_CACHE_LINE_SIZE 32
171 #if defined(_MSC_VER)
175 #if _MSC_VER > 1200 || defined(_mm_free)
176 #define CRYPTOPP_MSVC6PP_OR_LATER // VC 6 processor pack or later
178 #define CRYPTOPP_MSVC6_NO_PP // VC 6 without processor pack
182 #ifndef CRYPTOPP_ALIGN_DATA
183 #if defined(CRYPTOPP_MSVC6PP_OR_LATER)
184 #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x))
185 #elif defined(__GNUC__)
186 #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
188 #define CRYPTOPP_ALIGN_DATA(x)
192 #ifndef CRYPTOPP_SECTION_ALIGN16
193 #if defined(__GNUC__) && !defined(__APPLE__)
195 #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16")))
197 #define CRYPTOPP_SECTION_ALIGN16
201 #if defined(_MSC_VER) || defined(__fastcall)
202 #define CRYPTOPP_FASTCALL __fastcall
204 #define CRYPTOPP_FASTCALL
208 #if defined(_MSC_VER) && (_MSC_VER < 1300)
211 #define CPP_TYPENAME typename
215 #if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER)
216 #define CRYPTOPP_VC6_INT64 (__int64)
218 #define CRYPTOPP_VC6_INT64
222 #define CRYPTOPP_NO_VTABLE __declspec(novtable)
224 #define CRYPTOPP_NO_VTABLE
237 # pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355 4910)
245 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION)
246 #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
249 #ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
250 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
253 #ifdef CRYPTOPP_DISABLE_X86ASM // for backwards compatibility: this macro had both meanings
254 #define CRYPTOPP_DISABLE_ASM
255 #define CRYPTOPP_DISABLE_SSE2
258 #if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))))
260 #define CRYPTOPP_X86_ASM_AVAILABLE
262 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300)
263 #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1
265 #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0
270 #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102)
271 #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1
273 #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0
277 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64)
278 #define CRYPTOPP_X64_MASM_AVAILABLE
281 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__)
282 #define CRYPTOPP_X64_ASM_AVAILABLE
285 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__))
286 #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1
288 #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0
291 #if !defined(CRYPTOPP_DISABLE_SSSE3) && !defined(CRYPTOPP_DISABLE_AESNI) && CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE && (CRYPTOPP_GCC_VERSION >= 40400 || _MSC_FULL_VER >= 150030729 || __INTEL_COMPILER >= 1110)
292 #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 1
294 #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0
297 #if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
298 #define CRYPTOPP_BOOL_ALIGN16_ENABLED 1
300 #define CRYPTOPP_BOOL_ALIGN16_ENABLED 0
304 #if defined(CRYPTOPP_MSVC6PP_OR_LATER)
305 #define CRYPTOPP_MM_MALLOC_AVAILABLE
306 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
307 #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
308 #elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
309 #define CRYPTOPP_MEMALIGN_AVAILABLE
311 #define CRYPTOPP_NO_ALIGNED_ALLOC
315 #if defined(_MSC_VER) && _MSC_VER >= 1300
316 # define CRYPTOPP_NOINLINE_DOTDOTDOT
317 # define CRYPTOPP_NOINLINE __declspec(noinline)
318 #elif defined(__GNUC__)
319 # define CRYPTOPP_NOINLINE_DOTDOTDOT
320 # define CRYPTOPP_NOINLINE __attribute__((noinline))
322 # define CRYPTOPP_NOINLINE_DOTDOTDOT ...
323 # define CRYPTOPP_NOINLINE
327 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER)
328 # define CRYPTOPP_CONSTANT(x) enum {x};
330 # define CRYPTOPP_CONSTANT(x) static const int x;
333 #if defined(_M_X64) || defined(__x86_64__)
334 #define CRYPTOPP_BOOL_X64 1
336 #define CRYPTOPP_BOOL_X64 0
340 #if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)
341 #define CRYPTOPP_BOOL_X86 1
343 #define CRYPTOPP_BOOL_X86 0
346 #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || defined(__powerpc__)
347 #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
350 #define CRYPTOPP_VERSION 562
354 #ifndef NO_OS_DEPENDENCE
356 #if defined(_WIN32) || defined(__CYGWIN__)
357 #define CRYPTOPP_WIN32_AVAILABLE
360 #if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun)
361 #define CRYPTOPP_UNIX_AVAILABLE
364 #if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE)
365 # define HIGHRES_TIMER_AVAILABLE
368 #ifdef CRYPTOPP_UNIX_AVAILABLE
369 # define HAS_BERKELEY_STYLE_SOCKETS
372 #ifdef CRYPTOPP_WIN32_AVAILABLE
373 # define HAS_WINDOWS_STYLE_SOCKETS
376 #if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS))
377 # define SOCKETS_AVAILABLE
380 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS))
381 # define USE_WINDOWS_STYLE_SOCKETS
383 # define USE_BERKELEY_STYLE_SOCKETS
386 #if defined(HIGHRES_TIMER_AVAILABLE) && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS)
387 # define WINDOWS_PIPES_AVAILABLE
390 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI)
391 # define NONBLOCKING_RNG_AVAILABLE
392 # define OS_RNG_AVAILABLE
395 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
396 # define NONBLOCKING_RNG_AVAILABLE
397 # define BLOCKING_RNG_AVAILABLE
398 # define OS_RNG_AVAILABLE
399 # define HAS_PTHREADS
400 # define THREADS_AVAILABLE
403 #ifdef CRYPTOPP_WIN32_AVAILABLE
404 # define HAS_WINTHREADS
405 # define THREADS_AVAILABLE
408 #endif // NO_OS_DEPENDENCE
412 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
414 #ifdef CRYPTOPP_EXPORTS
415 #define CRYPTOPP_IS_DLL
416 #define CRYPTOPP_DLL __declspec(dllexport)
417 #elif defined(CRYPTOPP_IMPORTS)
418 #define CRYPTOPP_IS_DLL
419 #define CRYPTOPP_DLL __declspec(dllimport)
424 #define CRYPTOPP_API __cdecl
426 #else // CRYPTOPP_WIN32_AVAILABLE
431 #endif // CRYPTOPP_WIN32_AVAILABLE
433 #if defined(__MWERKS__)
434 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
435 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC)
436 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
438 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
441 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
442 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
444 #define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS
447 #if defined(__MWERKS__)
448 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class
449 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC)
450 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class
452 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class
455 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
456 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
458 #define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS