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
31 #ifndef DSA_1024_BIT_MODULUS_ONLY
32 # define DSA_1024_BIT_MODULUS_ONLY 1
40 #define GZIP_OS_CODE 0
52 #define PREFER_BERKELEY_STYLE_SOCKETS
56 #define CRYPTOPP_RIJNDAEL_NAME "AES"
63 # error namespace support is now required
69 #define WORKAROUND_MS_BUG_Q258000
71 #ifdef CRYPTOPP_DOXYGEN_PROCESSING
74 # define NAMESPACE_BEGIN(x)
75 # define NAMESPACE_END
77 # define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
79 # define NAMESPACE_BEGIN(x) namespace x {
80 # define NAMESPACE_END }
81 # define DOCUMENTED_TYPEDEF(x, y) typedef x y;
83 #define ANONYMOUS_NAMESPACE_BEGIN namespace {
84 #define USING_NAMESPACE(x) using namespace x;
85 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
86 #define DOCUMENTED_NAMESPACE_END }
92 #ifndef TYPE_OF_SOCKLEN_T
93 # if defined(_WIN32) || defined(__CYGWIN__)
94 # define TYPE_OF_SOCKLEN_T int
96 # define TYPE_OF_SOCKLEN_T ::socklen_t
100 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
101 # define __USE_W32_SOCKETS
104 typedef unsigned char byte;
106 NAMESPACE_BEGIN(CryptoPP)
108 typedef
unsigned short word16;
109 typedef
unsigned int word32;
111 #if defined(_MSC_VER) || defined(__BORLANDC__)
112 typedef unsigned __int64 word64;
113 #define W64LIT(x) x##ui64
115 typedef unsigned long long word64;
116 #define W64LIT(x) x##ULL
120 typedef word64 lword;
121 const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
124 #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
129 #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__))
130 typedef word32 hword;
133 #define CRYPTOPP_NATIVE_DWORD_AVAILABLE
134 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) || defined(__s390x__)
135 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && CRYPTOPP_GCC_VERSION >= 30400
138 typedef word32 hword;
140 typedef __uint128_t dword;
141 typedef __uint128_t word128;
142 #define CRYPTOPP_WORD128_AVAILABLE
145 typedef word16 hword;
147 typedef word64 dword;
151 #define CRYPTOPP_BOOL_SLOW_WORD64 1
152 typedef word16 hword;
154 typedef word64 dword;
157 #ifndef CRYPTOPP_BOOL_SLOW_WORD64
158 #define CRYPTOPP_BOOL_SLOW_WORD64 0
161 const unsigned int WORD_SIZE =
sizeof(word);
162 const unsigned int WORD_BITS = WORD_SIZE * 8;
166 #ifndef CRYPTOPP_L1_CACHE_LINE_SIZE
168 #if defined(_M_X64) || defined(__x86_64__)
169 #define CRYPTOPP_L1_CACHE_LINE_SIZE 64
172 #define CRYPTOPP_L1_CACHE_LINE_SIZE 32
176 #if defined(_MSC_VER)
180 #if _MSC_VER > 1200 || defined(_mm_free)
181 #define CRYPTOPP_MSVC6PP_OR_LATER // VC 6 processor pack or later
183 #define CRYPTOPP_MSVC6_NO_PP // VC 6 without processor pack
187 #ifndef CRYPTOPP_ALIGN_DATA
188 #if defined(CRYPTOPP_MSVC6PP_OR_LATER)
189 #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x))
190 #elif defined(__GNUC__)
191 #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
193 #define CRYPTOPP_ALIGN_DATA(x)
197 #ifndef CRYPTOPP_SECTION_ALIGN16
198 #if defined(__GNUC__) && !defined(__APPLE__)
200 #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16")))
202 #define CRYPTOPP_SECTION_ALIGN16
206 #if defined(_MSC_VER) || defined(__fastcall)
207 #define CRYPTOPP_FASTCALL __fastcall
209 #define CRYPTOPP_FASTCALL
213 #if defined(_MSC_VER) && (_MSC_VER < 1300)
216 #define CPP_TYPENAME typename
220 #if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER)
221 #define CRYPTOPP_VC6_INT64 (__int64)
223 #define CRYPTOPP_VC6_INT64
227 #define CRYPTOPP_NO_VTABLE __declspec(novtable)
229 #define CRYPTOPP_NO_VTABLE
242 # pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355 4910)
250 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION)
251 #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
254 #ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
255 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
258 #ifdef CRYPTOPP_DISABLE_X86ASM // for backwards compatibility: this macro had both meanings
259 #define CRYPTOPP_DISABLE_ASM
260 #define CRYPTOPP_DISABLE_SSE2
263 #if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))))
265 #define CRYPTOPP_X86_ASM_AVAILABLE
267 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300)
268 #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1
270 #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0
275 #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102)
276 #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1
278 #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0
282 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64)
283 #define CRYPTOPP_X64_MASM_AVAILABLE
286 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__)
287 #define CRYPTOPP_X64_ASM_AVAILABLE
290 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__))
291 #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1
293 #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0
296 #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)
297 #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 1
299 #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0
302 #if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
303 #define CRYPTOPP_BOOL_ALIGN16_ENABLED 1
305 #define CRYPTOPP_BOOL_ALIGN16_ENABLED 0
309 #if defined(CRYPTOPP_MSVC6PP_OR_LATER)
310 #define CRYPTOPP_MM_MALLOC_AVAILABLE
311 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
312 #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
313 #elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
314 #define CRYPTOPP_MEMALIGN_AVAILABLE
316 #define CRYPTOPP_NO_ALIGNED_ALLOC
320 #if defined(_MSC_VER) && _MSC_VER >= 1300
321 # define CRYPTOPP_NOINLINE_DOTDOTDOT
322 # define CRYPTOPP_NOINLINE __declspec(noinline)
323 #elif defined(__GNUC__)
324 # define CRYPTOPP_NOINLINE_DOTDOTDOT
325 # define CRYPTOPP_NOINLINE __attribute__((noinline))
327 # define CRYPTOPP_NOINLINE_DOTDOTDOT ...
328 # define CRYPTOPP_NOINLINE
332 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER)
333 # define CRYPTOPP_CONSTANT(x) enum {x};
335 # define CRYPTOPP_CONSTANT(x) static const int x;
338 #if defined(_M_X64) || defined(__x86_64__)
339 #define CRYPTOPP_BOOL_X64 1
341 #define CRYPTOPP_BOOL_X64 0
345 #if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)
346 #define CRYPTOPP_BOOL_X86 1
348 #define CRYPTOPP_BOOL_X86 0
351 #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || defined(__powerpc__)
352 #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
355 #define CRYPTOPP_VERSION 561
359 #ifndef NO_OS_DEPENDENCE
361 #if defined(_WIN32) || defined(__CYGWIN__)
362 #define CRYPTOPP_WIN32_AVAILABLE
365 #if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun)
366 #define CRYPTOPP_UNIX_AVAILABLE
369 #if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE)
370 # define HIGHRES_TIMER_AVAILABLE
373 #ifdef CRYPTOPP_UNIX_AVAILABLE
374 # define HAS_BERKELEY_STYLE_SOCKETS
377 #ifdef CRYPTOPP_WIN32_AVAILABLE
378 # define HAS_WINDOWS_STYLE_SOCKETS
381 #if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS))
382 # define SOCKETS_AVAILABLE
385 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS))
386 # define USE_WINDOWS_STYLE_SOCKETS
388 # define USE_BERKELEY_STYLE_SOCKETS
391 #if defined(HIGHRES_TIMER_AVAILABLE) && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS)
392 # define WINDOWS_PIPES_AVAILABLE
395 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI)
396 # define NONBLOCKING_RNG_AVAILABLE
397 # define OS_RNG_AVAILABLE
400 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
401 # define NONBLOCKING_RNG_AVAILABLE
402 # define BLOCKING_RNG_AVAILABLE
403 # define OS_RNG_AVAILABLE
404 # define HAS_PTHREADS
405 # define THREADS_AVAILABLE
408 #ifdef CRYPTOPP_WIN32_AVAILABLE
409 # define HAS_WINTHREADS
410 # define THREADS_AVAILABLE
413 #endif // NO_OS_DEPENDENCE
417 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
419 #ifdef CRYPTOPP_EXPORTS
420 #define CRYPTOPP_IS_DLL
421 #define CRYPTOPP_DLL __declspec(dllexport)
422 #elif defined(CRYPTOPP_IMPORTS)
423 #define CRYPTOPP_IS_DLL
424 #define CRYPTOPP_DLL __declspec(dllimport)
429 #define CRYPTOPP_API __cdecl
431 #else // CRYPTOPP_WIN32_AVAILABLE
436 #endif // CRYPTOPP_WIN32_AVAILABLE
438 #if defined(__MWERKS__)
439 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
440 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC)
441 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
443 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
446 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
447 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
449 #define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS
452 #if defined(__MWERKS__)
453 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class
454 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC)
455 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class
457 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class
460 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
461 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
463 #define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS