6 #ifndef CRYPTOPP_CONFIG_H 7 #define CRYPTOPP_CONFIG_H 12 #if !defined(CRYPTOPP_LITTLE_ENDIAN) && !defined(CRYPTOPP_BIG_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 CRYPTOPP_BIG_ENDIAN 1 18 #if !defined(CRYPTOPP_BIG_ENDIAN) && !defined(CRYPTOPP_LITTLE_ENDIAN) 19 # define CRYPTOPP_LITTLE_ENDIAN 1 24 #if defined(CRYPTOPP_BIG_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) 25 # error "CRYPTOPP_BIG_ENDIAN is set, but __BYTE_ORDER__ is not __ORDER_BIG_ENDIAN__" 27 #if defined(CRYPTOPP_LITTLE_ENDIAN) && defined(__GNUC__) && defined(__BYTE_ORDER__) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__) 28 # error "CRYPTOPP_LITTLE_ENDIAN is set, but __BYTE_ORDER__ is not __ORDER_LITTLE_ENDIAN__" 49 #if !defined(USE_MS_CRYPTOAPI) && !defined(USE_MS_CNGAPI) 50 # if !defined(_USING_V110_SDK71_) && ((WINVER >= 0x0602 ) || (_WIN32_WINNT >= 0x0602 )) 51 # define USE_MS_CNGAPI 53 # define USE_MS_CRYPTOAPI 82 #define CRYPTOPP_VERSION 610 87 #ifndef CRYPTOPP_DATA_DIR 88 # define CRYPTOPP_DATA_DIR "" 99 #if !defined(GZIP_OS_CODE) 100 # if defined(__macintosh__) 101 # define GZIP_OS_CODE 7 102 # elif defined(__unix__) || defined(__linux__) 103 # define GZIP_OS_CODE 3 105 # define GZIP_OS_CODE 0 130 #define CRYPTOPP_SLOW_ARMV8_SHIFT 1 140 #if !defined(NO_BERKELEY_STYLE_SOCKETS) && !defined(PREFER_BERKELEY_STYLE_SOCKETS) 141 # define PREFER_BERKELEY_STYLE_SOCKETS 149 #define CRYPTOPP_RIJNDAEL_NAME "AES" 157 #if (defined(DEBUG) || defined(_DEBUG)) && !defined(CRYPTOPP_DEBUG) 158 # define CRYPTOPP_DEBUG 1 166 # error namespace support is now required 169 #ifdef CRYPTOPP_DOXYGEN_PROCESSING 183 # define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 187 # define NAMESPACE_BEGIN(x) 188 # define NAMESPACE_END 190 # define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; 192 # define protected private 194 # define NAMESPACE_BEGIN(x) namespace x { 195 # define NAMESPACE_END } 196 # define DOCUMENTED_TYPEDEF(x, y) typedef x y; 198 #define ANONYMOUS_NAMESPACE_BEGIN namespace { 199 #define ANONYMOUS_NAMESPACE_END } 200 #define USING_NAMESPACE(x) using namespace x; 201 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x { 202 #define DOCUMENTED_NAMESPACE_END } 208 #ifndef TYPE_OF_SOCKLEN_T 209 # if defined(_WIN32) || defined(__CYGWIN__) 210 # define TYPE_OF_SOCKLEN_T int 212 # define TYPE_OF_SOCKLEN_T ::socklen_t 216 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS) 217 # define __USE_W32_SOCKETS 224 #define CRYPTOPP_NO_GLOBAL_BYTE 1 228 typedef unsigned char byte;
229 typedef unsigned short word16;
230 typedef unsigned int word32;
232 #if defined(_MSC_VER) || defined(__BORLANDC__) 233 typedef unsigned __int64 word64;
234 #define W64LIT(x) x##ui64 235 #elif (_LP64 || __LP64__) 236 typedef unsigned long word64;
237 #define W64LIT(x) x##UL 239 typedef unsigned long long word64;
240 #define W64LIT(x) x##ULL 244 typedef word64 lword;
245 const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
249 #if defined(_MSC_VER) && defined(__clang__) 250 # error: "Unsupported configuration" 254 #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 257 #if defined(__xlc__) || defined(__xlC__) 258 #define CRYPTOPP_XLC_VERSION ((__xlC__ / 256) * 10000 + (__xlC__ % 256) * 100) 262 #if defined(__clang__) && defined(__apple_build_version__) 263 #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) 264 #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1 265 #elif defined(__clang__) 266 #define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) 267 #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1 271 #define CRYPTOPP_MSC_VERSION (_MSC_VER) 275 #if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) 276 #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 281 #if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION <= 200000)) || \ 282 (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 200000)) || \ 283 defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) 284 #define CRYPTOPP_DISABLE_INTEL_ASM 1 289 #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__)) 290 typedef word32 hword;
293 #define CRYPTOPP_NATIVE_DWORD_AVAILABLE 1 294 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) 295 #if ((CRYPTOPP_GCC_VERSION >= 30400) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30000) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300)) && (__SIZEOF_INT128__ >= 16) 299 typedef word32 hword;
301 typedef __uint128_t dword;
302 typedef __uint128_t word128;
303 #define CRYPTOPP_WORD128_AVAILABLE 1 306 typedef word16 hword;
308 typedef word64 dword;
312 #define CRYPTOPP_BOOL_SLOW_WORD64 1 313 typedef word16 hword;
315 typedef word64 dword;
318 #ifndef CRYPTOPP_BOOL_SLOW_WORD64 319 #define CRYPTOPP_BOOL_SLOW_WORD64 0 322 const unsigned int WORD_SIZE =
sizeof(word);
323 const unsigned int WORD_BITS = WORD_SIZE * 8;
327 #ifndef CRYPTOPP_L1_CACHE_LINE_SIZE 330 #if defined(_M_X64) || defined(__x86_64__) || defined(__arm64__) || defined(__aarch64__) || defined(__powerpc64__) || defined(_ARCH_PPC64) 331 #define CRYPTOPP_L1_CACHE_LINE_SIZE 64 334 #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 338 #ifndef CRYPTOPP_ALIGN_DATA 339 #if defined(_MSC_VER) 340 #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) 341 #elif defined(__GNUC__) 342 #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) 344 #define CRYPTOPP_ALIGN_DATA(x) 349 #if ((defined(__MACH__) && defined(__APPLE__)) && ((CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70100) || (CRYPTOPP_GCC_VERSION >= 40300))) 350 #define CRYPTOPP_SECTION_INIT __attribute__((section ("__DATA,__data"))) 351 #elif (defined(__ELF__) && (CRYPTOPP_GCC_VERSION >= 40300)) 352 #define CRYPTOPP_SECTION_INIT __attribute__((section ("nocommon"))) 354 #define CRYPTOPP_SECTION_INIT 357 #if defined(_MSC_VER) || defined(__fastcall) 358 #define CRYPTOPP_FASTCALL __fastcall 360 #define CRYPTOPP_FASTCALL 364 #define CRYPTOPP_NO_VTABLE __declspec(novtable) 366 #define CRYPTOPP_NO_VTABLE 382 # pragma warning(disable: 4127 4512 4661 4910) 385 # pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928) 394 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 395 # pragma GCC diagnostic ignored "-Wunknown-pragmas" 396 # pragma GCC diagnostic ignored "-Wunused-function" 402 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || (defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x450) || defined(_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT))) 403 #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION 406 #ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION 407 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE 415 #if (defined(__ILP32__) || defined(_ILP32)) && defined(__x86_64__) 416 #define CRYPTOPP_BOOL_X32 1 420 #if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)) && !CRYPTOPP_BOOL_X32 421 #define CRYPTOPP_BOOL_X86 1 424 #if (defined(_M_X64) || defined(__x86_64__)) && !CRYPTOPP_BOOL_X32 425 #define CRYPTOPP_BOOL_X64 1 429 #if CRYPTOPP_BOOL_X32 430 # undef CRYPTOPP_BOOL_X64 431 # undef CRYPTOPP_X64_ASM_AVAILABLE 432 # undef CRYPTOPP_X64_MASM_AVAILABLE 437 #if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) 438 #define CRYPTOPP_BOOL_ARM64 1 439 #elif defined(__arm__) || defined(__aarch32__) || defined(_M_ARM) 440 #define CRYPTOPP_BOOL_ARM32 1 444 #if defined(__powerpc64__) || defined(_ARCH_PPC64) 445 #define CRYPTOPP_BOOL_PPC64 1 446 #elif defined(__powerpc__) || defined(_ARCH_PPC) 447 #define CRYPTOPP_BOOL_PPC32 1 450 #if defined(_MSC_VER) || defined(__BORLANDC__) 451 # define CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY 1 453 # define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 1 458 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 461 #if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000) 462 # define CRYPTOPP_DISABLE_ASM 467 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(__SSE2__) && defined(__x86_64__) && (__SUNPRO_CC >= 0x5100) 471 #if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))) 473 #define CRYPTOPP_X86_ASM_AVAILABLE 1 475 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(_MSC_VER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__)) 476 #define CRYPTOPP_SSE2_ASM_AVAILABLE 1 479 #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1500 || defined(__SSSE3__)) 480 #define CRYPTOPP_SSSE3_ASM_AVAILABLE 1 484 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64) 485 #define CRYPTOPP_X64_MASM_AVAILABLE 1 488 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) 489 #define CRYPTOPP_X64_ASM_AVAILABLE 1 493 #if !defined(CRYPTOPP_DISABLE_ASM) && (defined(_MSC_VER) || defined(__SSE2__)) 494 #define CRYPTOPP_SSE2_INTRIN_AVAILABLE 1 497 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_SSSE3) 498 # if defined(__SSSE3__) || (_MSC_VER >= 1500) || \ 499 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || (__SUNPRO_CC >= 0x5110) || \ 500 (CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) 501 #define CRYPTOPP_SSSE3_AVAILABLE 1 508 #if !defined(CRYPTOPP_DISABLE_SSE4) && defined(CRYPTOPP_SSSE3_AVAILABLE) && \ 509 (defined(__SSE4_1__) || (CRYPTOPP_MSC_VERSION >= 1500) || \ 510 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || (__SUNPRO_CC >= 0x5110) || \ 511 (CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000)) 512 #define CRYPTOPP_SSE41_AVAILABLE 1 515 #if !defined(CRYPTOPP_DISABLE_SSE4) && defined(CRYPTOPP_SSSE3_AVAILABLE) && \ 516 (defined(__SSE4_2__) || (CRYPTOPP_MSC_VERSION >= 1500) || (__SUNPRO_CC >= 0x5110) || \ 517 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || \ 518 (CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000)) 519 #define CRYPTOPP_SSE42_AVAILABLE 1 524 #if defined(CRYPTOPP_DISABLE_AES) 525 #define CRYPTOPP_DISABLE_CLMUL 1 529 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_CLMUL) && defined(CRYPTOPP_SSE42_AVAILABLE) && \ 530 (defined(__PCLMUL__) || (_MSC_FULL_VER >= 150030729) || (__SUNPRO_CC >= 0x5120) || \ 531 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1110) || \ 532 (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300)) 533 #define CRYPTOPP_CLMUL_AVAILABLE 1 537 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_AES) && defined(CRYPTOPP_SSE42_AVAILABLE) && \ 538 (defined(__AES__) || (_MSC_FULL_VER >= 150030729) || (__SUNPRO_CC >= 0x5120) || \ 539 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1110) || \ 540 (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300)) 541 #define CRYPTOPP_AESNI_AVAILABLE 1 546 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_SHA) && defined(CRYPTOPP_SSE42_AVAILABLE) && \ 547 (defined(__SHA__) || (CRYPTOPP_MSC_VERSION >= 1900) || (__SUNPRO_CC >= 0x5160) || \ 548 (CRYPTOPP_GCC_VERSION >= 40900) || (__INTEL_COMPILER >= 1300) || \ 549 (CRYPTOPP_LLVM_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50100)) 550 #define CRYPTOPP_SHANI_AVAILABLE 1 553 #endif // X86, X32, X64 557 #if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) 561 #if !defined(CRYPTOPP_ARM_NEON_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) 562 # if defined(__ARM_NEON) || defined(__ARM_NEON_FP) || defined(__ARM_FEATURE_NEON) || \ 563 (__ARM_ARCH >= 7) || (CRYPTOPP_MSC_VERSION >= 1700) 564 # define CRYPTOPP_ARM_NEON_AVAILABLE 1 570 #if !defined(CRYPTOPP_ARM_ASIMD_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) 571 # if defined(__aarch32__) || defined(__aarch64__) || (CRYPTOPP_MSC_VERSION >= 1910) 572 # define CRYPTOPP_ARM_ASIMD_AVAILABLE 1 581 #if !defined(CRYPTOPP_ARM_CRC32_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__apple_build_version__) && !defined(__ANDROID__) 582 # if (defined(__ARM_FEATURE_CRC32) || (CRYPTOPP_MSC_VERSION >= 1910) || \ 583 defined(__aarch32__) || defined(__aarch64__)) 584 # define CRYPTOPP_ARM_CRC32_AVAILABLE 1 593 #if !defined(CRYPTOPP_ARM_PMULL_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__apple_build_version__) && !defined(__ANDROID__) 594 # if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_MSC_VERSION >= 1910) || \ 595 defined(__aarch32__) || defined(__aarch64__) 596 # define CRYPTOPP_ARM_PMULL_AVAILABLE 1 605 #if !defined(CRYPTOPP_ARM_AES_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__ANDROID__) 606 # if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_MSC_VERSION >= 1910) || \ 607 defined(__aarch32__) || defined(__aarch64__) 608 # define CRYPTOPP_ARM_AES_AVAILABLE 1 617 #if !defined(CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__ANDROID__) 618 # if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_MSC_VERSION >= 1910) || \ 619 defined(__aarch32__) || defined(__aarch64__) 620 # define CRYPTOPP_ARM_SHA_AVAILABLE 1 625 #if defined(__aarch32__) || defined(__aarch64__) || (__ARM_ARCH >= 8) || defined(__ARM_ACLE) 626 # define CRYPTOPP_ARM_ACLE_AVAILABLE 1 631 #if defined(__ANDROID__) || defined(ANDROID) || defined(__APPLE__) 632 # undef CRYPTOPP_ARM_ACLE_AVAILABLE 635 #endif // ARM32, ARM64 639 #if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) 641 #if defined(CRYPTOPP_DISABLE_ALTIVEC) || defined(CRYPTOPP_DISABLE_ASM) 642 # undef CRYPTOPP_DISABLE_ALTIVEC 643 # undef CRYPTOPP_DISABLE_POWER7 644 # undef CRYPTOPP_DISABLE_POWER8 645 # define CRYPTOPP_DISABLE_ALTIVEC 1 646 # define CRYPTOPP_DISABLE_POWER7 1 647 # define CRYPTOPP_DISABLE_POWER8 1 651 #if !defined(CRYPTOPP_ALTIVEC_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ALTIVEC) 652 # if defined(_ARCH_PWR4) || defined(__ALTIVEC__) || \ 653 (CRYPTOPP_XLC_VERSION >= 100000) || (CRYPTOPP_GCC_VERSION >= 40001) 654 # define CRYPTOPP_ALTIVEC_AVAILABLE 1 659 #if !defined(CRYPTOPP_POWER5_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER5) && defined(CRYPTOPP_ALTIVEC_AVAILABLE) 660 # if defined(_ARCH_PWR5) || (CRYPTOPP_XLC_VERSION >= 100000) || (CRYPTOPP_GCC_VERSION >= 40100) 661 # define CRYPTOPP_POWER5_AVAILABLE 1 666 #if !defined(CRYPTOPP_POWER7_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER7) && defined(CRYPTOPP_ALTIVEC_AVAILABLE) 667 # if defined(_ARCH_PWR7) || (CRYPTOPP_XLC_VERSION >= 100000) || (CRYPTOPP_GCC_VERSION >= 40100) 668 # define CRYPTOPP_POWER7_AVAILABLE 1 673 #if !defined(CRYPTOPP_POWER8_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER8) && defined(CRYPTOPP_POWER7_AVAILABLE) 674 # if defined(_ARCH_PWR8) || (CRYPTOPP_XLC_VERSION >= 130000) || (CRYPTOPP_GCC_VERSION >= 40800) 675 # define CRYPTOPP_POWER8_AVAILABLE 1 679 #if !defined(CRYPTOPP_POWER8_AES_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER8_AES) && defined(CRYPTOPP_POWER8_AVAILABLE) 680 # if defined(__CRYPTO__) || defined(_ARCH_PWR8) || (CRYPTOPP_XLC_VERSION >= 130000) || (CRYPTOPP_GCC_VERSION >= 40800) 681 # define CRYPTOPP_POWER8_AES_AVAILABLE 1 692 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) && !defined(CRYPTOPP_DISABLE_ASM) 693 #define CRYPTOPP_BOOL_ALIGN16 1 695 #define CRYPTOPP_BOOL_ALIGN16 0 700 #if defined(_MSC_VER) 701 #define CRYPTOPP_MM_MALLOC_AVAILABLE 702 #elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) 703 #define CRYPTOPP_MEMALIGN_AVAILABLE 704 #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 705 #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16 706 #elif (defined(_GNU_SOURCE) || ((_XOPEN_SOURCE + 0) >= 600)) && (_POSIX_ADVISORY_INFO > 0) 707 #define CRYPTOPP_POSIX_MEMALIGN_AVAILABLE 709 #define CRYPTOPP_NO_ALIGNED_ALLOC 713 #if defined(_MSC_VER) 714 # define CRYPTOPP_NOINLINE_DOTDOTDOT 715 # define CRYPTOPP_NOINLINE __declspec(noinline) 716 #elif defined(__xlc__) || defined(__xlC__) 717 # define CRYPTOPP_NOINLINE_DOTDOTDOT ... 718 # define CRYPTOPP_NOINLINE __attribute__((noinline)) 719 #elif defined(__GNUC__) 720 # define CRYPTOPP_NOINLINE_DOTDOTDOT 721 # define CRYPTOPP_NOINLINE __attribute__((noinline)) 723 # define CRYPTOPP_NOINLINE_DOTDOTDOT ... 724 # define CRYPTOPP_NOINLINE 728 #if defined(CRYPTOPP_DOXYGEN_PROCESSING) || defined(__BORLANDC__) 729 # define CRYPTOPP_CONSTANT(x) static const int x; 731 # define CRYPTOPP_CONSTANT(x) enum {x}; 742 #if defined(__APPLE__) 743 # define CRYPTOPP_NO_CPU_FEATURE_PROBES 1 755 #ifndef CRYPTOPP_INIT_PRIORITY 756 # define CRYPTOPP_INIT_PRIORITY 250 762 #if defined(CRYPTOPP_INIT_PRIORITY) && (CRYPTOPP_INIT_PRIORITY > 0) 763 # define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY + 101) 765 # define CRYPTOPP_USER_PRIORITY 350 769 #if (CRYPTOPP_INIT_PRIORITY > 0) && !(defined(NO_OS_DEPENDENCE) || defined(__APPLE__) || defined(__sun__)) 770 # if (CRYPTOPP_GCC_VERSION >= 30000) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 800) 771 # define HAVE_GCC_INIT_PRIORITY 1 772 # elif (CRYPTOPP_MSC_VERSION >= 1310) 773 # define HAVE_MSC_INIT_PRIORITY 1 775 #endif // CRYPTOPP_INIT_PRIORITY, NO_OS_DEPENDENCE, Apple, Sun 779 #ifndef NO_OS_DEPENDENCE 781 #if defined(_WIN32) || defined(__CYGWIN__) 782 #define CRYPTOPP_WIN32_AVAILABLE 785 #if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun) 786 #define CRYPTOPP_UNIX_AVAILABLE 789 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 790 #define CRYPTOPP_BSD_AVAILABLE 793 #if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) 794 # define HIGHRES_TIMER_AVAILABLE 797 #ifdef CRYPTOPP_WIN32_AVAILABLE 798 # if !defined(WINAPI_FAMILY) 799 # define THREAD_TIMER_AVAILABLE 800 # elif defined(WINAPI_FAMILY) 801 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 802 # define THREAD_TIMER_AVAILABLE 807 #ifdef CRYPTOPP_UNIX_AVAILABLE 808 # define HAS_BERKELEY_STYLE_SOCKETS 809 # define SOCKETS_AVAILABLE 813 #ifdef CRYPTOPP_WIN32_AVAILABLE 814 # define HAS_WINDOWS_STYLE_SOCKETS 815 # if !defined(WINAPI_FAMILY) 816 # define SOCKETS_AVAILABLE 817 # elif defined(WINAPI_FAMILY) 818 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 819 # define SOCKETS_AVAILABLE 824 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS)) 825 # define USE_WINDOWS_STYLE_SOCKETS 827 # define USE_BERKELEY_STYLE_SOCKETS 830 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(SOCKETS_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS) 831 # define WINDOWS_PIPES_AVAILABLE 835 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) 836 # define NONBLOCKING_RNG_AVAILABLE 837 # define BLOCKING_RNG_AVAILABLE 838 # define OS_RNG_AVAILABLE 839 # define HAS_PTHREADS 840 # define THREADS_AVAILABLE 844 #if defined(_AIX) && defined(__xlC__) 846 # undef THREADS_AVAILABLE 850 #if defined(CRYPTOPP_UNIX_AVAILABLE) 851 # define UNIX_SIGNALS_AVAILABLE 1 854 #ifdef CRYPTOPP_WIN32_AVAILABLE 855 # if !defined(WINAPI_FAMILY) 856 # define HAS_WINTHREADS 857 # define THREADS_AVAILABLE 858 # define NONBLOCKING_RNG_AVAILABLE 859 # define OS_RNG_AVAILABLE 860 # elif defined(WINAPI_FAMILY) 861 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 862 # define HAS_WINTHREADS 863 # define THREADS_AVAILABLE 864 # define NONBLOCKING_RNG_AVAILABLE 865 # define OS_RNG_AVAILABLE 866 # elif !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 867 # if ((WINVER >= 0x0A00 ) || (_WIN32_WINNT >= 0x0A00 )) 868 # define NONBLOCKING_RNG_AVAILABLE 869 # define OS_RNG_AVAILABLE 875 #endif // NO_OS_DEPENDENCE 879 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 881 #ifdef CRYPTOPP_EXPORTS 882 #define CRYPTOPP_IS_DLL 883 #define CRYPTOPP_DLL __declspec(dllexport) 884 #elif defined(CRYPTOPP_IMPORTS) 885 #define CRYPTOPP_IS_DLL 886 #define CRYPTOPP_DLL __declspec(dllimport) 892 #define CRYPTOPP_TABLE extern 893 #define CRYPTOPP_API __cdecl 895 #else // not CRYPTOPP_WIN32_AVAILABLE 898 #define CRYPTOPP_TABLE extern 902 #endif // CRYPTOPP_WIN32_AVAILABLE 904 #if defined(__MWERKS__) 905 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL 906 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC) 907 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL 909 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL 912 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS) 913 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL 915 #define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS 918 #if defined(__MWERKS__) 919 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class 920 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC) 921 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class 923 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class 926 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS) 927 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class 929 #define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS 936 #define CRYPTOPP_UNUSED(x) ((void)(x)) 940 #if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40200) 941 # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg))) 942 #elif (CRYPTOPP_GCC_VERSION) 943 # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated)) 945 # define CRYPTOPP_DEPRECATED(msg) 951 #if (CRYPTOPP_LLVM_CLANG_VERSION >= 30700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) 952 # define CRYPTOPP_NO_SANITIZE(x) __attribute__((no_sanitize(x))) 954 # define CRYPTOPP_NO_SANITIZE(x) 966 #ifndef __has_feature 967 # define __has_feature(x) 0 970 #if !defined(CRYPTOPP_NO_CXX11) 971 # if ((_MSC_VER >= 1600) || (__cplusplus >= 201103L)) && !defined(_STLPORT_VERSION) 972 # define CRYPTOPP_CXX11 1 981 #if defined(__APPLE__) && defined(__clang__) 982 # if !(defined(__has_include) && __has_include(<forward_list>)) 983 # undef CRYPTOPP_CXX11 988 #if defined(CRYPTOPP_CXX11) 991 #if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_atomic) || \ 992 (__INTEL_COMPILER >= 1300) || (CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5140) 993 # define CRYPTOPP_CXX11_ATOMICS 1 998 #if (CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || \ 999 (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) || (__INTEL_COMPILER >= 1200) || \ 1000 (CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5130) 1007 # if !defined(__GLIBCXX__) || defined(_GLIBCXX_HAS_GTHREADS) 1008 # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 1010 #endif // synchronization 1016 #if (CRYPTOPP_MSC_VERSION >= 1900) && ((WINVER >= 0x0600) || (_WIN32_WINNT >= 0x0600)) || \ 1017 (CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || \ 1018 (__INTEL_COMPILER >= 1110) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130) 1019 # define CRYPTOPP_CXX11_DYNAMIC_INIT 1 1020 #endif // Dynamic Initialization compilers 1023 #if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_alignas) || \ 1024 (__INTEL_COMPILER >= 1500) || (CRYPTOPP_GCC_VERSION >= 40800) || (__SUNPRO_CC >= 0x5130) 1025 # define CRYPTOPP_CXX11_ALIGNAS 1 1029 #if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_alignof) || \ 1030 (__INTEL_COMPILER >= 1500) || (CRYPTOPP_GCC_VERSION >= 40500) || (__SUNPRO_CC >= 0x5130) 1031 # define CRYPTOPP_CXX11_ALIGNOF 1 1035 #if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_lambdas) || \ 1036 (__INTEL_COMPILER >= 1200) || (CRYPTOPP_GCC_VERSION >= 40900) || (__SUNPRO_CC >= 0x5140) 1037 # define CRYPTOPP_CXX11_LAMBDA 1 1041 #if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_noexcept) || \ 1042 (__INTEL_COMPILER >= 1400) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130) 1043 # define CRYPTOPP_CXX11_NOEXCEPT 1 1044 #endif // noexcept compilers 1047 #if (CRYPTOPP_MSC_VERSION >= 1800) || __has_feature(cxx_variadic_templates) || \ 1048 (__INTEL_COMPILER >= 1210) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130) 1049 # define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 1050 #endif // variadic templates 1054 #if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_constexpr) || \ 1055 (__INTEL_COMPILER >= 1600) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130) 1056 # define CRYPTOPP_CXX11_CONSTEXPR 1 1057 #endif // constexpr compilers 1061 #if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_strong_enums) || \ 1062 (__INTEL_COMPILER >= 1400) || (CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5120) 1063 # define CRYPTOPP_CXX11_ENUM 1 1064 #endif // constexpr compilers 1067 #if (CRYPTOPP_MSC_VERSION >= 1600) || __has_feature(cxx_nullptr) || \ 1068 (__INTEL_COMPILER >= 1000) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130) 1069 # define CRYPTOPP_CXX11_NULLPTR 1 1070 #endif // nullptr_t compilers 1072 #endif // CRYPTOPP_CXX11 1077 #if !defined(CRYPTOPP_NO_CXX17) 1078 # if ((_MSC_VER >= 1900) || (__cplusplus >= 201703L)) && !defined(_STLPORT_VERSION) 1079 # define CRYPTOPP_CXX17 1 1084 #if defined(CRYPTOPP_CXX17) 1088 #if defined(__clang__) 1089 # if __EXCEPTIONS && __has_feature(cxx_exceptions) 1090 # define CRYPTOPP_CXX17_EXCEPTIONS 1 1092 #elif (CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1800) || (CRYPTOPP_GCC_VERSION >= 60000) 1093 # define CRYPTOPP_CXX17_EXCEPTIONS 1 1094 #endif // uncaught_exceptions compilers 1096 #endif // CRYPTOPP_CXX17 1100 #if defined(CRYPTOPP_CXX11_NOEXCEPT) 1101 # define CRYPTOPP_THROW noexcept(false) 1102 # define CRYPTOPP_NO_THROW noexcept(true) 1104 # define CRYPTOPP_THROW 1105 # define CRYPTOPP_NO_THROW 1106 #endif // CRYPTOPP_CXX11_NOEXCEPT 1109 #if defined(CRYPTOPP_CXX11_CONSTEXPR) 1110 # define CRYPTOPP_STATIC_CONSTEXPR static constexpr 1111 # define CRYPTOPP_CONSTEXPR constexpr 1113 # define CRYPTOPP_STATIC_CONSTEXPR static 1114 # define CRYPTOPP_CONSTEXPR 1115 #endif // CRYPTOPP_CXX11_CONSTEXPR 1118 #if defined(CRYPTOPP_CXX11_ALIGNAS) 1119 # undef CRYPTOPP_ALIGN_DATA 1120 # define CRYPTOPP_ALIGN_DATA(x) alignas(x) 1121 #endif // CRYPTOPP_CXX11_ALIGNAS 1132 #if defined(CRYPTOPP_CXX11_ENUM) 1133 # undef CRYPTOPP_CONSTANT 1134 # define CRYPTOPP_CONSTANT(x) enum : int { x }; 1135 #elif defined(CRYPTOPP_CXX11_CONSTEXPR) 1136 # undef CRYPTOPP_CONSTANT 1137 # define CRYPTOPP_CONSTANT(x) constexpr static int x; 1141 #if defined(CRYPTOPP_CXX11_NULLPTR) && !defined(NULLPTR) 1142 # define NULLPTR nullptr 1143 #elif !defined(NULLPTR) 1144 # define NULLPTR NULL 1145 #endif // CRYPTOPP_CXX11_NULLPTR 1149 #if (defined(__cplusplus) && (__cplusplus >= 199711L) && (__cplusplus < 201402L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) 1150 # error "std::uncaught_exception is not available. This is likely a configuration error." 1153 #endif // CRYPTOPP_CONFIG_H Crypto++ library namespace.