6 #ifndef CRYPTOPP_CONFIG_H 7 #define CRYPTOPP_CONFIG_H 12 #if !defined(IS_LITTLE_ENDIAN) && (defined(__BIG_ENDIAN__) || (defined(__s390__) || defined(__s390x__) || defined(__zarch__)) || (defined(__m68k__) || defined(__MC68K__)) || defined(__sparc) || defined(__sparc__) || defined(__hppa__) || defined(__MIPSEB__) || defined(__ARMEB__) || (defined(__MWERKS__) && !defined(__INTEL__))) 13 # define IS_BIG_ENDIAN 19 # define IS_LITTLE_ENDIAN 24 #if defined(IS_BIG_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) 25 # error "IS_BIG_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_BIG_ENDIAN__" 27 #if defined(IS_LITTLE_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__) 28 # error "IS_LITTLE_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_LITTLE_ENDIAN__" 49 #if !defined(USE_MS_CRYPTOAPI) && !defined(USE_MS_CNGAPI) 50 # if (_MSC_VER >= 1900) || ((WINVER >= 0x0A00 ) || (_WIN32_WINNT >= 0x0A00 )) 51 # define USE_MS_CNGAPI 53 # define USE_MS_CRYPTOAPI 59 #ifndef CRYPTOPP_NO_UNALIGNED_DATA_ACCESS 66 #define CRYPTOPP_VERSION 564 71 #ifndef CRYPTOPP_DATA_DIR 72 # define CRYPTOPP_DATA_DIR "" 80 #if (CRYPTOPP_VERSION <= 600) 81 # if !defined(CRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562) && !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562) 82 # define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 93 #if !defined(GZIP_OS_CODE) 94 # define GZIP_OS_CODE 0 115 #if !defined(NO_BERKELEY_STYLE_SOCKETS) && !defined(PREFER_BERKELEY_STYLE_SOCKETS) 116 # define PREFER_BERKELEY_STYLE_SOCKETS 124 #define CRYPTOPP_RIJNDAEL_NAME "AES" 135 #if defined(CRYPTOPP_INIT_PRIORITY) && (CRYPTOPP_INIT_PRIORITY > 0) 136 # define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY + 101) 138 # define CRYPTOPP_USER_PRIORITY 250 146 # error namespace support is now required 152 #define WORKAROUND_MS_BUG_Q258000 154 #ifdef CRYPTOPP_DOXYGEN_PROCESSING 166 # define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 170 # define NAMESPACE_BEGIN(x) 171 # define NAMESPACE_END 173 # define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; 175 # define protected private 177 # define NAMESPACE_BEGIN(x) namespace x { 178 # define NAMESPACE_END } 179 # define DOCUMENTED_TYPEDEF(x, y) typedef x y; 181 #define ANONYMOUS_NAMESPACE_BEGIN namespace { 182 #define ANONYMOUS_NAMESPACE_END } 183 #define USING_NAMESPACE(x) using namespace x; 184 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x { 185 #define DOCUMENTED_NAMESPACE_END } 191 #ifndef TYPE_OF_SOCKLEN_T 192 # if defined(_WIN32) || defined(__CYGWIN__) 193 # define TYPE_OF_SOCKLEN_T int 195 # define TYPE_OF_SOCKLEN_T ::socklen_t 199 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS) 200 # define __USE_W32_SOCKETS 203 typedef unsigned char byte;
207 typedef unsigned short word16;
208 typedef unsigned int word32;
210 #if defined(_MSC_VER) || defined(__BORLANDC__) 211 typedef unsigned __int64 word64;
212 #define W64LIT(x) x##ui64 213 #elif (_LP64 || __LP64__) && ((__arm64__ || __aarch64__) || !defined(CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562)) 214 typedef unsigned long word64;
215 #define W64LIT(x) x##UL 217 typedef unsigned long long word64;
218 #define W64LIT(x) x##ULL 222 typedef word64 lword;
223 const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
227 #if defined(_MSC_VER) && defined(__clang__) 228 # error: "Unsupported configuration" 232 #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 236 #if defined(__clang__ ) && !defined(__apple_build_version__) 237 #define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) 238 #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1 239 #elif defined(__clang__ ) && defined(__apple_build_version__) 240 #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) 241 #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1 245 #define CRYPTOPP_MSC_VERSION (_MSC_VER) 249 #if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) 250 #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 255 #if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && CRYPTOPP_LLVM_CLANG_VERSION <= 200000) || (defined(CRYPTOPP_APPLE_CLANG_VERSION) && CRYPTOPP_APPLE_CLANG_VERSION <= 200000) || defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) 256 #define CRYPTOPP_DISABLE_INTEL_ASM 1 261 #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__)) 262 typedef word32 hword;
265 #define CRYPTOPP_NATIVE_DWORD_AVAILABLE 1 266 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) 267 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && CRYPTOPP_GCC_VERSION >= 30400 270 typedef word32 hword;
272 typedef __uint128_t dword;
273 typedef __uint128_t word128;
274 #define CRYPTOPP_WORD128_AVAILABLE 1 277 typedef word16 hword;
279 typedef word64 dword;
283 #define CRYPTOPP_BOOL_SLOW_WORD64 1 284 typedef word16 hword;
286 typedef word64 dword;
289 #ifndef CRYPTOPP_BOOL_SLOW_WORD64 290 #define CRYPTOPP_BOOL_SLOW_WORD64 0 293 const unsigned int WORD_SIZE =
sizeof(word);
294 const unsigned int WORD_BITS = WORD_SIZE * 8;
298 #ifndef CRYPTOPP_L1_CACHE_LINE_SIZE 301 #if defined(_M_X64) || defined(__x86_64__) || (__arm64__) || (__aarch64__) 302 #define CRYPTOPP_L1_CACHE_LINE_SIZE 64 305 #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 309 #if defined(_MSC_VER) 313 #if _MSC_VER > 1200 || defined(_mm_free) 314 #define CRYPTOPP_MSVC6PP_OR_LATER // VC 6 processor pack or later 316 #define CRYPTOPP_MSVC6_NO_PP // VC 6 without processor pack 320 #ifndef CRYPTOPP_ALIGN_DATA 321 #if defined(CRYPTOPP_MSVC6PP_OR_LATER) 322 #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) 323 #elif defined(__GNUC__) 324 #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) 326 #define CRYPTOPP_ALIGN_DATA(x) 330 #ifndef CRYPTOPP_SECTION_ALIGN16 331 #if defined(__GNUC__) && !defined(__APPLE__) 333 #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16"))) 335 #define CRYPTOPP_SECTION_ALIGN16 340 #if ((defined(__MACH__) && defined(__APPLE__)) && ((CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70100) || (CRYPTOPP_GCC_VERSION >= 40300))) 341 #define CRYPTOPP_SECTION_INIT __attribute__((section ("__DATA,__data"))) 342 #elif (defined(__ELF__) && (CRYPTOPP_GCC_VERSION >= 40300)) 343 #define CRYPTOPP_SECTION_INIT __attribute__((section ("nocommon"))) 345 #define CRYPTOPP_SECTION_INIT 348 #if defined(_MSC_VER) || defined(__fastcall) 349 #define CRYPTOPP_FASTCALL __fastcall 351 #define CRYPTOPP_FASTCALL 355 #if defined(_MSC_VER) && (_MSC_VER < 1300) 358 #define CPP_TYPENAME typename 362 #if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER) 363 #define CRYPTOPP_VC6_INT64 (__int64) 365 #define CRYPTOPP_VC6_INT64 369 #define CRYPTOPP_NO_VTABLE __declspec(novtable) 371 #define CRYPTOPP_NO_VTABLE 387 # pragma warning(disable: 4127 4231 4250 4251 4275 4505 4512 4660 4661 4786 4355 4910) 390 # pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928) 399 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 400 # pragma GCC diagnostic ignored "-Wunknown-pragmas" 401 # pragma GCC diagnostic ignored "-Wunused-function" 407 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || (defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x450) || defined(_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT))) 408 #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION 411 #ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION 412 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE 415 #ifdef CRYPTOPP_DISABLE_X86ASM // for backwards compatibility: this macro had both meanings 416 #define CRYPTOPP_DISABLE_ASM 417 #define CRYPTOPP_DISABLE_SSE2 421 #if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000) 422 # define CRYPTOPP_DISABLE_ASM 427 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(__SSE2__) && defined(__x86_64__) && (__SUNPRO_CC >= 0x5100) 431 #if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))) 433 #define CRYPTOPP_X86_ASM_AVAILABLE 435 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__)) 436 #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1 438 #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0 444 #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102 || defined(__SSSE3__)) 445 #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1 447 #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0 451 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64) 452 #define CRYPTOPP_X64_MASM_AVAILABLE 455 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) 456 #define CRYPTOPP_X64_ASM_AVAILABLE 459 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__)) && !defined(_M_ARM) 460 #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1 462 #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0 469 #if !defined(CRYPTOPP_DISABLE_SSE2) && !defined(CRYPTOPP_DISABLE_SSE4) && (((_MSC_VER >= 1500) && !defined(_M_ARM)) || (defined(__SSE4_1__) && defined(__SSE4_2__))) 470 #define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 1 472 #define CRYPTOPP_BOOL_SSE4_INTRINSICS_AVAILABLE 0 475 #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 || defined(__AES__)) 476 #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 1 478 #define CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE 0 482 #if !defined(CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) 483 # if defined(__ARM_NEON__) || defined(__ARM_NEON) || defined(_M_ARM) 484 # define CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE 1 491 #if !defined(CRYPTOPP_BOOL_ARM_CRC32_INTRINSICS_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) 492 # if defined(__ARM_FEATURE_CRC32) || defined(_M_ARM64) 493 # define CRYPTOPP_BOOL_ARM_CRC32_INTRINSICS_AVAILABLE 1 500 #if !defined(CRYPTOPP_BOOL_ARM_CRYPTO_INTRINSICS_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) 501 # if defined(__ARM_FEATURE_CRYPTO) || defined(_M_ARM64) 502 # define CRYPTOPP_BOOL_ARM_CRYPTO_INTRINSICS_AVAILABLE 1 506 #if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE) 507 #define CRYPTOPP_BOOL_ALIGN16 1 509 #define CRYPTOPP_BOOL_ALIGN16 0 513 #if defined(CRYPTOPP_MSVC6PP_OR_LATER) 514 #define CRYPTOPP_MM_MALLOC_AVAILABLE 515 #elif defined(__APPLE__) 516 #define CRYPTOPP_APPLE_MALLOC_AVAILABLE 517 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 518 #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16 519 #elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) 520 #define CRYPTOPP_MEMALIGN_AVAILABLE 522 #define CRYPTOPP_NO_ALIGNED_ALLOC 529 #if defined(_MSC_VER) && _MSC_VER >= 1300 530 # define CRYPTOPP_NOINLINE_DOTDOTDOT 531 # define CRYPTOPP_NOINLINE __declspec(noinline) 532 #elif defined(__GNUC__) 533 # define CRYPTOPP_NOINLINE_DOTDOTDOT 534 # define CRYPTOPP_NOINLINE __attribute__((noinline)) 536 # define CRYPTOPP_NOINLINE_DOTDOTDOT ... 537 # define CRYPTOPP_NOINLINE 542 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER) || defined(__BORLANDC__) 543 # define CRYPTOPP_CONSTANT(x) enum {x}; 545 # define CRYPTOPP_CONSTANT(x) static const int x; 551 #if ((__ILP32__ >= 1) || (_ILP32 >= 1)) && defined(__x86_64__) 552 #define CRYPTOPP_BOOL_X32 1 554 #define CRYPTOPP_BOOL_X32 0 558 #if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)) && !CRYPTOPP_BOOL_X32 559 #define CRYPTOPP_BOOL_X86 1 561 #define CRYPTOPP_BOOL_X86 0 564 #if (defined(_M_X64) || defined(__x86_64__)) && !CRYPTOPP_BOOL_X32 565 #define CRYPTOPP_BOOL_X64 1 567 #define CRYPTOPP_BOOL_X64 0 571 #if CRYPTOPP_BOOL_X32 572 # undef CRYPTOPP_BOOL_X64 573 # undef CRYPTOPP_X64_ASM_AVAILABLE 574 # undef CRYPTOPP_X64_MASM_AVAILABLE 577 #if defined(__arm__) || defined(__aarch32__) || defined(_M_ARM) 578 #define CRYPTOPP_BOOL_ARM32 1 580 #define CRYPTOPP_BOOL_ARM32 0 585 #if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) 586 #define CRYPTOPP_BOOL_ARM64 1 588 #define CRYPTOPP_BOOL_ARM64 0 591 #if !defined(CRYPTOPP_NO_UNALIGNED_DATA_ACCESS) && !defined(CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS) 592 #if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || defined(__powerpc__) || (__ARM_FEATURE_UNALIGNED >= 1)) 593 #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS 599 #ifndef NO_OS_DEPENDENCE 601 #if defined(_WIN32) || defined(__CYGWIN__) 602 #define CRYPTOPP_WIN32_AVAILABLE 605 #if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun) 606 #define CRYPTOPP_UNIX_AVAILABLE 609 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 610 #define CRYPTOPP_BSD_AVAILABLE 613 #if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) 614 # define HIGHRES_TIMER_AVAILABLE 617 #ifdef CRYPTOPP_WIN32_AVAILABLE 618 # if !defined(WINAPI_FAMILY) 619 # define THREAD_TIMER_AVAILABLE 620 # elif defined(WINAPI_FAMILY) 621 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 622 # define THREAD_TIMER_AVAILABLE 627 #ifdef CRYPTOPP_UNIX_AVAILABLE 628 # define HAS_BERKELEY_STYLE_SOCKETS 629 # define SOCKETS_AVAILABLE 633 #ifdef CRYPTOPP_WIN32_AVAILABLE 634 # define HAS_WINDOWS_STYLE_SOCKETS 635 # if !defined(WINAPI_FAMILY) 636 # define SOCKETS_AVAILABLE 637 # elif defined(WINAPI_FAMILY) 638 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 639 # define SOCKETS_AVAILABLE 644 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS)) 645 # define USE_WINDOWS_STYLE_SOCKETS 647 # define USE_BERKELEY_STYLE_SOCKETS 650 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(SOCKETS_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS) 651 # define WINDOWS_PIPES_AVAILABLE 654 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) 655 # define NONBLOCKING_RNG_AVAILABLE 656 # define BLOCKING_RNG_AVAILABLE 657 # define OS_RNG_AVAILABLE 658 # define HAS_PTHREADS 659 # define THREADS_AVAILABLE 662 #ifdef CRYPTOPP_WIN32_AVAILABLE 663 # if !defined(WINAPI_FAMILY) 664 # define HAS_WINTHREADS 665 # define THREADS_AVAILABLE 666 # define NONBLOCKING_RNG_AVAILABLE 667 # define OS_RNG_AVAILABLE 668 # elif defined(WINAPI_FAMILY) 669 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 670 # define HAS_WINTHREADS 671 # define THREADS_AVAILABLE 672 # define NONBLOCKING_RNG_AVAILABLE 673 # define OS_RNG_AVAILABLE 674 # elif !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 675 # if ((WINVER >= 0x0A00 ) || (_WIN32_WINNT >= 0x0A00 )) 676 # define NONBLOCKING_RNG_AVAILABLE 677 # define OS_RNG_AVAILABLE 683 #endif // NO_OS_DEPENDENCE 687 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 689 #ifdef CRYPTOPP_EXPORTS 690 #define CRYPTOPP_IS_DLL 691 #define CRYPTOPP_DLL __declspec(dllexport) 692 #elif defined(CRYPTOPP_IMPORTS) 693 #define CRYPTOPP_IS_DLL 694 #define CRYPTOPP_DLL __declspec(dllimport) 699 #define CRYPTOPP_API __cdecl 701 #else // not CRYPTOPP_WIN32_AVAILABLE 706 #endif // CRYPTOPP_WIN32_AVAILABLE 708 #if defined(__MWERKS__) 709 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL 710 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC) 711 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL 713 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL 716 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS) 717 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL 719 #define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS 722 #if defined(__MWERKS__) 723 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class 724 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC) 725 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class 727 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class 730 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS) 731 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class 733 #define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS 740 #define CRYPTOPP_UNUSED(x) ((void)x) 744 #if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) 745 # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg))); 746 #elif (CRYPTOPP_GCC_VERSION) 747 # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated)); 749 # define CRYPTOPP_DEPRECATED(msg) 758 #if ((_MSC_VER >= 1600) || (__cplusplus >= 201103L)) && !defined(_STLPORT_VERSION) 759 # define CRYPTOPP_CXX11 1 767 #if defined(__APPLE__) && defined(__clang__) 768 # if !(defined(__has_include) && __has_include(<forward_list>)) 769 # undef CRYPTOPP_CXX11 774 #if defined(CRYPTOPP_CXX11) 777 #if (CRYPTOPP_MSC_VERSION >= 1700) 778 # define CRYPTOPP_CXX11_ATOMICS 1 779 #elif (__INTEL_COMPILER >= 1300) 780 # define CRYPTOPP_CXX11_ATOMICS 1 781 #elif defined(__clang__) 782 # if __has_feature(cxx_atomic) 783 # define CRYPTOPP_CXX11_ATOMICS 1 785 #elif (CRYPTOPP_GCC_VERSION >= 40400) 786 # define CRYPTOPP_CXX11_ATOMICS 1 787 #elif (__SUNPRO_CC >= 0x5140) 788 # define CRYPTOPP_CXX11_ATOMICS 1 793 #if (CRYPTOPP_MSC_VERSION >= 1700) 794 # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 795 #elif (__INTEL_COMPILER >= 1200) 796 # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 797 #elif (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) 798 # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 799 #elif (CRYPTOPP_GCC_VERSION >= 40400) 800 # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 801 #elif (__SUNPRO_CC >= 0x5130) 802 # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 803 #endif // synchronization 806 #if (CRYPTOPP_MSC_VERSION >= 1900) 807 # define CRYPTOPP_CXX11_ALIGNAS 1 808 # define CRYPTOPP_CXX11_ALIGNOF 1 809 #elif (__INTEL_COMPILER >= 1500) 810 # define CRYPTOPP_CXX11_ALIGNAS 1 811 # define CRYPTOPP_CXX11_ALIGNOF 1 812 #elif defined(__clang__) 813 # if __has_feature(cxx_alignas) 814 # define CRYPTOPP_CXX11_ALIGNAS 1 816 # if __has_feature(cxx_alignof) 817 # define CRYPTOPP_CXX11_ALIGNOF 1 819 #elif (CRYPTOPP_GCC_VERSION >= 40800) 820 # define CRYPTOPP_CXX11_ALIGNAS 1 821 # define CRYPTOPP_CXX11_ALIGNOF 1 822 #elif (__SUNPRO_CC >= 0x5130) 823 # define CRYPTOPP_CXX11_ALIGNAS 1 824 # define CRYPTOPP_CXX11_ALIGNOF 1 825 #endif // alignof/alignas 828 #if (CRYPTOPP_MSC_VERSION >= 1900) 829 # define CRYPTOPP_CXX11_NOEXCEPT 1 830 #elif (__INTEL_COMPILER >= 1400) 831 # define CRYPTOPP_CXX11_NOEXCEPT 1 832 #elif defined(__clang__) 833 # if __has_feature(cxx_noexcept) 834 # define CRYPTOPP_CXX11_NOEXCEPT 1 836 #elif (CRYPTOPP_GCC_VERSION >= 40600) 837 # define CRYPTOPP_CXX11_NOEXCEPT 1 838 #elif (__SUNPRO_CC >= 0x5130) 839 # define CRYPTOPP_CXX11_NOEXCEPT 1 840 #endif // noexcept compilers 843 #if (CRYPTOPP_MSC_VERSION >= 1800) 844 # define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 845 #elif (__INTEL_COMPILER >= 1210) 846 # define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 847 #elif defined(__clang__) 848 # if __has_feature(cxx_variadic_templates) 849 # define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 851 #elif (CRYPTOPP_GCC_VERSION >= 40300) 852 # define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 853 #elif (__SUNPRO_CC >= 0x5130) 854 # define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 855 #endif // variadic templates 859 #if (CRYPTOPP_MSC_VERSION >= 1900) 860 # define CRYPTOPP_CXX11_CONSTEXPR 1 861 #elif (__INTEL_COMPILER >= 1600) 862 # define CRYPTOPP_CXX11_CONSTEXPR 1 863 #elif defined(__clang__) 864 # if __has_feature(cxx_constexpr) 865 # define CRYPTOPP_CXX11_CONSTEXPR 1 867 #elif (CRYPTOPP_GCC_VERSION >= 40600) 868 # define CRYPTOPP_CXX11_CONSTEXPR 1 869 #elif (__SUNPRO_CC >= 0x5130) 870 # define CRYPTOPP_CXX11_CONSTEXPR 1 871 #endif // constexpr compilers 876 #endif // CRYPTOPP_CXX11 878 #if defined(CRYPTOPP_CXX11_NOEXCEPT) 879 # define CRYPTOPP_THROW noexcept(false) 880 # define CRYPTOPP_NO_THROW noexcept(true) 882 # define CRYPTOPP_THROW 883 # define CRYPTOPP_NO_THROW 884 #endif // CRYPTOPP_CXX11_NOEXCEPT 886 #if defined(CRYPTOPP_CXX11_CONSTEXPR) 887 # define CRYPTOPP_CONSTEXPR constexpr 889 # define CRYPTOPP_CONSTEXPR 890 #endif // CRYPTOPP_CXX11_CONSTEXPR 893 #if defined(CRYPTOPP_CXX11_ALIGNAS) 894 # undef CRYPTOPP_ALIGN_DATA 895 # define CRYPTOPP_ALIGN_DATA(x) alignas(x) 896 #endif // CRYPTOPP_CXX11_ALIGNAS 899 #if defined(CRYPTOPP_CXX11_CONSTEXPR) 900 # undef CRYPTOPP_CONSTANT 901 # define CRYPTOPP_CONSTANT(x) constexpr static int x; 906 #if (defined(__cplusplus) && (__cplusplus >= 199711L) && (__cplusplus < 201402L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) 907 # error "std::uncaught_exception is not available. This is likely a configuration error." Crypto++ library namespace.