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 88 #define CRYPTOPP_VERSION 700 93 #ifndef CRYPTOPP_DATA_DIR 94 # define CRYPTOPP_DATA_DIR "" 105 #if !defined(GZIP_OS_CODE) 106 # if defined(__macintosh__) 107 # define GZIP_OS_CODE 7 108 # elif defined(__unix__) || defined(__linux__) 109 # define GZIP_OS_CODE 3 111 # define GZIP_OS_CODE 0 136 #define CRYPTOPP_SLOW_ARMV8_SHIFT 1 146 #if !defined(NO_BERKELEY_STYLE_SOCKETS) && !defined(PREFER_BERKELEY_STYLE_SOCKETS) 147 # define PREFER_BERKELEY_STYLE_SOCKETS 155 #define CRYPTOPP_RIJNDAEL_NAME "AES" 163 #if (defined(DEBUG) || defined(_DEBUG)) && !defined(CRYPTOPP_DEBUG) 164 # define CRYPTOPP_DEBUG 1 172 # error namespace support is now required 175 #ifdef CRYPTOPP_DOXYGEN_PROCESSING 189 # define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 193 # define NAMESPACE_BEGIN(x) 194 # define NAMESPACE_END 196 # define DOCUMENTED_TYPEDEF(x, y) class y : public x {}; 198 # define protected private 200 # define NAMESPACE_BEGIN(x) namespace x { 201 # define NAMESPACE_END } 202 # define DOCUMENTED_TYPEDEF(x, y) typedef x y; 204 #define ANONYMOUS_NAMESPACE_BEGIN namespace { 205 #define ANONYMOUS_NAMESPACE_END } 206 #define USING_NAMESPACE(x) using namespace x; 207 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x { 208 #define DOCUMENTED_NAMESPACE_END } 214 #ifndef TYPE_OF_SOCKLEN_T 215 # if defined(_WIN32) || defined(__CYGWIN__) 216 # define TYPE_OF_SOCKLEN_T int 218 # define TYPE_OF_SOCKLEN_T ::socklen_t 222 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS) 223 # define __USE_W32_SOCKETS 230 #define CRYPTOPP_NO_GLOBAL_BYTE 1 237 typedef unsigned char byte;
238 typedef unsigned short word16;
239 typedef unsigned int word32;
241 typedef signed char sbyte;
242 typedef signed short sword16;
243 typedef signed int sword32;
245 #if defined(_MSC_VER) || defined(__BORLANDC__) 246 typedef signed __int64 sword64;
247 typedef unsigned __int64 word64;
248 #define SW64LIT(x) x##i64 249 #define W64LIT(x) x##ui64 250 #elif (_LP64 || __LP64__) 251 typedef signed long sword64;
252 typedef unsigned long word64;
253 #define SW64LIT(x) x##L 254 #define W64LIT(x) x##UL 256 typedef signed long long sword64;
257 typedef unsigned long long word64;
258 #define SW64LIT(x) x##LL 259 #define W64LIT(x) x##ULL 263 typedef word64 lword;
264 const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
268 #if defined(_MSC_VER) && defined(__clang__) 269 # error: "Unsupported configuration" 273 #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 276 #if defined(__xlc__) || defined(__xlC__) 277 #define CRYPTOPP_XLC_VERSION ((__xlC__ / 256) * 10000 + (__xlC__ % 256) * 100) 281 #if defined(__clang__) && defined(__apple_build_version__) 282 #define CRYPTOPP_APPLE_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) 283 #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1 284 #elif defined(__clang__) 285 #define CRYPTOPP_LLVM_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) 286 #define CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER 1 290 #define CRYPTOPP_MSC_VERSION (_MSC_VER) 294 #if (CRYPTOPP_GCC_VERSION >= 40600) || (CRYPTOPP_LLVM_CLANG_VERSION >= 10700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 20000) 295 #define CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 1 300 #if (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION <= 200000)) || \ 301 (defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION <= 200000)) || \ 302 defined(CRYPTOPP_CLANG_INTEGRATED_ASSEMBLER) 303 #define CRYPTOPP_DISABLE_INTEL_ASM 1 308 #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__)) 309 typedef word32 hword;
312 #define CRYPTOPP_NATIVE_DWORD_AVAILABLE 1 313 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) 314 #if ((CRYPTOPP_GCC_VERSION >= 30400) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30000) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300)) && (__SIZEOF_INT128__ >= 16) 318 typedef word32 hword;
320 typedef __uint128_t dword;
321 typedef __uint128_t word128;
322 #define CRYPTOPP_WORD128_AVAILABLE 1 325 typedef word16 hword;
327 typedef word64 dword;
331 #define CRYPTOPP_BOOL_SLOW_WORD64 1 332 typedef word16 hword;
334 typedef word64 dword;
337 #ifndef CRYPTOPP_BOOL_SLOW_WORD64 338 #define CRYPTOPP_BOOL_SLOW_WORD64 0 341 const unsigned int WORD_SIZE =
sizeof(word);
342 const unsigned int WORD_BITS = WORD_SIZE * 8;
346 #ifndef CRYPTOPP_L1_CACHE_LINE_SIZE 349 #if defined(_M_X64) || defined(__x86_64__) || defined(__arm64__) || defined(__aarch64__) || defined(__powerpc64__) || defined(_ARCH_PPC64) 350 #define CRYPTOPP_L1_CACHE_LINE_SIZE 64 353 #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 357 #ifndef CRYPTOPP_ALIGN_DATA 358 #if defined(_MSC_VER) 359 #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) 360 #elif defined(__GNUC__) 361 #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) 363 #define CRYPTOPP_ALIGN_DATA(x) 368 #if ((defined(__MACH__) && defined(__APPLE__)) && ((CRYPTOPP_LLVM_CLANG_VERSION >= 30600) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70100) || (CRYPTOPP_GCC_VERSION >= 40300))) 369 #define CRYPTOPP_SECTION_INIT __attribute__((section ("__DATA,__data"))) 370 #elif (defined(__ELF__) && (CRYPTOPP_GCC_VERSION >= 40300)) 371 #define CRYPTOPP_SECTION_INIT __attribute__((section ("nocommon"))) 373 #define CRYPTOPP_SECTION_INIT 376 #if defined(_MSC_VER) || defined(__fastcall) 377 #define CRYPTOPP_FASTCALL __fastcall 379 #define CRYPTOPP_FASTCALL 383 #define CRYPTOPP_NO_VTABLE __declspec(novtable) 385 #define CRYPTOPP_NO_VTABLE 401 # pragma warning(disable: 4127 4512 4661 4910) 404 # pragma warning(once: 4191 4242 4263 4264 4266 4302 4826 4905 4906 4928) 413 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 414 # pragma GCC diagnostic ignored "-Wunknown-pragmas" 415 # pragma GCC diagnostic ignored "-Wunused-function" 421 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || (defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x450) || defined(_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT))) 422 #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION 425 #ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION 426 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE 434 #if (defined(__ILP32__) || defined(_ILP32)) && defined(__x86_64__) 435 #define CRYPTOPP_BOOL_X32 1 439 #if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)) && !CRYPTOPP_BOOL_X32 440 #define CRYPTOPP_BOOL_X86 1 443 #if (defined(_M_X64) || defined(__x86_64__)) && !CRYPTOPP_BOOL_X32 444 #define CRYPTOPP_BOOL_X64 1 448 #if CRYPTOPP_BOOL_X32 449 # undef CRYPTOPP_BOOL_X64 450 # undef CRYPTOPP_X64_ASM_AVAILABLE 451 # undef CRYPTOPP_X64_MASM_AVAILABLE 456 #if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) 457 #define CRYPTOPP_BOOL_ARM64 1 458 #elif defined(__arm__) || defined(__aarch32__) || defined(_M_ARM) 459 #define CRYPTOPP_BOOL_ARM32 1 463 #if defined(__powerpc64__) || defined(_ARCH_PPC64) 464 #define CRYPTOPP_BOOL_PPC64 1 465 #elif defined(__powerpc__) || defined(_ARCH_PPC) 466 #define CRYPTOPP_BOOL_PPC32 1 469 #if defined(_MSC_VER) || defined(__BORLANDC__) 470 # define CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY 1 472 # define CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 1 477 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 480 #if defined(CRYPTOPP_APPLE_CLANG_VERSION) && (CRYPTOPP_APPLE_CLANG_VERSION < 50000) 481 # define CRYPTOPP_DISABLE_ASM 486 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(__SSE2__) && defined(__x86_64__) && (__SUNPRO_CC >= 0x5100) 490 #if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))) 492 #define CRYPTOPP_X86_ASM_AVAILABLE 1 494 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(_MSC_VER) || CRYPTOPP_GCC_VERSION >= 30300 || defined(__SSE2__)) 495 #define CRYPTOPP_SSE2_ASM_AVAILABLE 1 498 #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1500 || defined(__SSSE3__)) 499 #define CRYPTOPP_SSSE3_ASM_AVAILABLE 1 503 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64) 504 #define CRYPTOPP_X64_MASM_AVAILABLE 1 507 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__) 508 #define CRYPTOPP_X64_ASM_AVAILABLE 1 512 #if !defined(CRYPTOPP_DISABLE_ASM) && (defined(_MSC_VER) || defined(__SSE2__)) 513 #define CRYPTOPP_SSE2_INTRIN_AVAILABLE 1 516 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_SSSE3) 517 # if defined(__SSSE3__) || (_MSC_VER >= 1500) || \ 518 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || (__SUNPRO_CC >= 0x5110) || \ 519 (CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) 520 #define CRYPTOPP_SSSE3_AVAILABLE 1 527 #if !defined(CRYPTOPP_DISABLE_SSE4) && defined(CRYPTOPP_SSSE3_AVAILABLE) && \ 528 (defined(__SSE4_1__) || (CRYPTOPP_MSC_VERSION >= 1500) || \ 529 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || (__SUNPRO_CC >= 0x5110) || \ 530 (CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000)) 531 #define CRYPTOPP_SSE41_AVAILABLE 1 534 #if !defined(CRYPTOPP_DISABLE_SSE4) && defined(CRYPTOPP_SSSE3_AVAILABLE) && \ 535 (defined(__SSE4_2__) || (CRYPTOPP_MSC_VERSION >= 1500) || (__SUNPRO_CC >= 0x5110) || \ 536 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1000) || \ 537 (CRYPTOPP_LLVM_CLANG_VERSION >= 20300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000)) 538 #define CRYPTOPP_SSE42_AVAILABLE 1 543 #if defined(CRYPTOPP_DISABLE_AES) 544 #define CRYPTOPP_DISABLE_CLMUL 1 548 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_CLMUL) && defined(CRYPTOPP_SSE42_AVAILABLE) && \ 549 (defined(__PCLMUL__) || (_MSC_FULL_VER >= 150030729) || (__SUNPRO_CC >= 0x5120) || \ 550 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1110) || \ 551 (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300)) 552 #define CRYPTOPP_CLMUL_AVAILABLE 1 556 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_AES) && defined(CRYPTOPP_SSE42_AVAILABLE) && \ 557 (defined(__AES__) || (_MSC_FULL_VER >= 150030729) || (__SUNPRO_CC >= 0x5120) || \ 558 (CRYPTOPP_GCC_VERSION >= 40300) || (__INTEL_COMPILER >= 1110) || \ 559 (CRYPTOPP_LLVM_CLANG_VERSION >= 30200) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300)) 560 #define CRYPTOPP_AESNI_AVAILABLE 1 565 #if !defined(CRYPTOPP_DISABLE_ASM) && !defined(CRYPTOPP_DISABLE_SHA) && defined(CRYPTOPP_SSE42_AVAILABLE) && \ 566 (defined(__SHA__) || (CRYPTOPP_MSC_VERSION >= 1900) || (__SUNPRO_CC >= 0x5160) || \ 567 (CRYPTOPP_GCC_VERSION >= 40900) || (__INTEL_COMPILER >= 1300) || \ 568 (CRYPTOPP_LLVM_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50100)) 569 #define CRYPTOPP_SHANI_AVAILABLE 1 572 #endif // X86, X32, X64 576 #if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) 580 #if !defined(CRYPTOPP_ARM_NEON_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) 581 # if defined(__ARM_NEON) || defined(__ARM_NEON_FP) || defined(__ARM_FEATURE_NEON) || \ 582 (__ARM_ARCH >= 7) || (CRYPTOPP_MSC_VERSION >= 1700) 583 # define CRYPTOPP_ARM_NEON_AVAILABLE 1 589 #if !defined(CRYPTOPP_ARM_ASIMD_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) 590 # if defined(__aarch32__) || defined(__aarch64__) || (CRYPTOPP_MSC_VERSION >= 1910) 591 # define CRYPTOPP_ARM_ASIMD_AVAILABLE 1 600 #if !defined(CRYPTOPP_ARM_CRC32_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__apple_build_version__) && !defined(__ANDROID__) 601 # if (defined(__ARM_FEATURE_CRC32) || (CRYPTOPP_MSC_VERSION >= 1910) || \ 602 defined(__aarch32__) || defined(__aarch64__)) 603 # define CRYPTOPP_ARM_CRC32_AVAILABLE 1 612 #if !defined(CRYPTOPP_ARM_PMULL_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__apple_build_version__) && !defined(__ANDROID__) 613 # if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_MSC_VERSION >= 1910) || \ 614 defined(__aarch32__) || defined(__aarch64__) 615 # define CRYPTOPP_ARM_PMULL_AVAILABLE 1 624 #if !defined(CRYPTOPP_ARM_AES_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__ANDROID__) 625 # if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_MSC_VERSION >= 1910) || \ 626 defined(__aarch32__) || defined(__aarch64__) 627 # define CRYPTOPP_ARM_AES_AVAILABLE 1 636 #if !defined(CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(__ANDROID__) 637 # if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_MSC_VERSION >= 1910) || \ 638 defined(__aarch32__) || defined(__aarch64__) 639 # define CRYPTOPP_ARM_SHA_AVAILABLE 1 644 #if defined(__aarch32__) || defined(__aarch64__) || (__ARM_ARCH >= 8) || defined(__ARM_ACLE) 645 # define CRYPTOPP_ARM_ACLE_AVAILABLE 1 650 #if defined(__ANDROID__) || defined(ANDROID) || defined(__APPLE__) 651 # undef CRYPTOPP_ARM_ACLE_AVAILABLE 654 #endif // ARM32, ARM64 658 #if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) 660 #if defined(CRYPTOPP_DISABLE_ALTIVEC) || defined(CRYPTOPP_DISABLE_ASM) 661 # undef CRYPTOPP_DISABLE_ALTIVEC 662 # undef CRYPTOPP_DISABLE_POWER7 663 # undef CRYPTOPP_DISABLE_POWER8 664 # define CRYPTOPP_DISABLE_ALTIVEC 1 665 # define CRYPTOPP_DISABLE_POWER7 1 666 # define CRYPTOPP_DISABLE_POWER8 1 670 #if !defined(CRYPTOPP_ALTIVEC_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ALTIVEC) 671 # if defined(_ARCH_PWR4) || defined(__ALTIVEC__) || \ 672 (CRYPTOPP_XLC_VERSION >= 100000) || (CRYPTOPP_GCC_VERSION >= 40001) 673 # define CRYPTOPP_ALTIVEC_AVAILABLE 1 678 #if !defined(CRYPTOPP_POWER5_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER5) && defined(CRYPTOPP_ALTIVEC_AVAILABLE) 679 # if defined(_ARCH_PWR5) || (CRYPTOPP_XLC_VERSION >= 100000) || (CRYPTOPP_GCC_VERSION >= 40100) 680 # define CRYPTOPP_POWER5_AVAILABLE 1 685 #if !defined(CRYPTOPP_POWER7_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER7) && defined(CRYPTOPP_ALTIVEC_AVAILABLE) 686 # if defined(_ARCH_PWR7) || (CRYPTOPP_XLC_VERSION >= 100000) || (CRYPTOPP_GCC_VERSION >= 40100) 687 # define CRYPTOPP_POWER7_AVAILABLE 1 692 #if !defined(CRYPTOPP_POWER8_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER8) && defined(CRYPTOPP_POWER7_AVAILABLE) 693 # if defined(_ARCH_PWR8) || (CRYPTOPP_XLC_VERSION >= 130000) || (CRYPTOPP_GCC_VERSION >= 40800) 694 # define CRYPTOPP_POWER8_AVAILABLE 1 698 #if !defined(CRYPTOPP_POWER8_AES_AVAILABLE) && !defined(CRYPTOPP_DISABLE_POWER8_AES) && defined(CRYPTOPP_POWER8_AVAILABLE) 699 # if defined(__CRYPTO__) || defined(_ARCH_PWR8) || (CRYPTOPP_XLC_VERSION >= 130000) || (CRYPTOPP_GCC_VERSION >= 40800) 700 # define CRYPTOPP_POWER8_AES_AVAILABLE 1 701 # define CRYPTOPP_POWER8_SHA_AVAILABLE 1 711 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) && !defined(CRYPTOPP_DISABLE_ASM) 712 #define CRYPTOPP_BOOL_ALIGN16 1 714 #define CRYPTOPP_BOOL_ALIGN16 0 719 #if defined(_MSC_VER) 720 #define CRYPTOPP_MM_MALLOC_AVAILABLE 721 #elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__) 722 #define CRYPTOPP_MEMALIGN_AVAILABLE 723 #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 724 #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16 725 #elif (defined(_GNU_SOURCE) || ((_XOPEN_SOURCE + 0) >= 600)) && (_POSIX_ADVISORY_INFO > 0) 726 #define CRYPTOPP_POSIX_MEMALIGN_AVAILABLE 728 #define CRYPTOPP_NO_ALIGNED_ALLOC 732 #if defined(_MSC_VER) 733 # define CRYPTOPP_NOINLINE_DOTDOTDOT 734 # define CRYPTOPP_NOINLINE __declspec(noinline) 735 #elif defined(__xlc__) || defined(__xlC__) 736 # define CRYPTOPP_NOINLINE_DOTDOTDOT ... 737 # define CRYPTOPP_NOINLINE __attribute__((noinline)) 738 #elif defined(__GNUC__) 739 # define CRYPTOPP_NOINLINE_DOTDOTDOT 740 # define CRYPTOPP_NOINLINE __attribute__((noinline)) 742 # define CRYPTOPP_NOINLINE_DOTDOTDOT ... 743 # define CRYPTOPP_NOINLINE 747 #if defined(CRYPTOPP_DOXYGEN_PROCESSING) || defined(__BORLANDC__) 748 # define CRYPTOPP_CONSTANT(x) static const int x; 750 # define CRYPTOPP_CONSTANT(x) enum {x}; 761 #if defined(__APPLE__) 762 # define CRYPTOPP_NO_CPU_FEATURE_PROBES 1 774 #ifndef CRYPTOPP_INIT_PRIORITY 775 # define CRYPTOPP_INIT_PRIORITY 250 781 #if defined(CRYPTOPP_INIT_PRIORITY) && (CRYPTOPP_INIT_PRIORITY > 0) 782 # define CRYPTOPP_USER_PRIORITY (CRYPTOPP_INIT_PRIORITY + 101) 784 # define CRYPTOPP_USER_PRIORITY 350 788 #if (CRYPTOPP_INIT_PRIORITY > 0) && !(defined(NO_OS_DEPENDENCE) || defined(__APPLE__) || defined(__sun__)) 789 # if (CRYPTOPP_GCC_VERSION >= 30000) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (_INTEL_COMPILER >= 800) 790 # define HAVE_GCC_INIT_PRIORITY 1 791 # elif (CRYPTOPP_MSC_VERSION >= 1310) 792 # define HAVE_MSC_INIT_PRIORITY 1 794 #endif // CRYPTOPP_INIT_PRIORITY, NO_OS_DEPENDENCE, Apple, Sun 798 #ifndef NO_OS_DEPENDENCE 800 #if defined(_WIN32) || defined(__CYGWIN__) 801 #define CRYPTOPP_WIN32_AVAILABLE 804 #if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun) 805 #define CRYPTOPP_UNIX_AVAILABLE 808 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 809 #define CRYPTOPP_BSD_AVAILABLE 812 #if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE) 813 # define HIGHRES_TIMER_AVAILABLE 816 #ifdef CRYPTOPP_WIN32_AVAILABLE 817 # if !defined(WINAPI_FAMILY) 818 # define THREAD_TIMER_AVAILABLE 819 # elif defined(WINAPI_FAMILY) 820 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 821 # define THREAD_TIMER_AVAILABLE 826 #ifdef CRYPTOPP_UNIX_AVAILABLE 827 # define HAS_BERKELEY_STYLE_SOCKETS 828 # define SOCKETS_AVAILABLE 832 #ifdef CRYPTOPP_WIN32_AVAILABLE 833 # define HAS_WINDOWS_STYLE_SOCKETS 834 # if !defined(WINAPI_FAMILY) 835 # define SOCKETS_AVAILABLE 836 # elif defined(WINAPI_FAMILY) 837 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 838 # define SOCKETS_AVAILABLE 843 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS)) 844 # define USE_WINDOWS_STYLE_SOCKETS 846 # define USE_BERKELEY_STYLE_SOCKETS 849 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(SOCKETS_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS) 850 # define WINDOWS_PIPES_AVAILABLE 854 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING) 855 # define NONBLOCKING_RNG_AVAILABLE 856 # define BLOCKING_RNG_AVAILABLE 857 # define OS_RNG_AVAILABLE 858 # define HAS_PTHREADS 859 # define THREADS_AVAILABLE 863 #if defined(_AIX) && defined(__xlC__) 865 # undef THREADS_AVAILABLE 869 #if defined(CRYPTOPP_UNIX_AVAILABLE) 870 # define UNIX_SIGNALS_AVAILABLE 1 873 #ifdef CRYPTOPP_WIN32_AVAILABLE 874 # if !defined(WINAPI_FAMILY) 875 # define HAS_WINTHREADS 876 # define THREADS_AVAILABLE 877 # define NONBLOCKING_RNG_AVAILABLE 878 # define OS_RNG_AVAILABLE 879 # elif defined(WINAPI_FAMILY) 880 # if (WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 881 # define HAS_WINTHREADS 882 # define THREADS_AVAILABLE 883 # define NONBLOCKING_RNG_AVAILABLE 884 # define OS_RNG_AVAILABLE 885 # elif !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) 886 # if ((WINVER >= 0x0A00 ) || (_WIN32_WINNT >= 0x0A00 )) 887 # define NONBLOCKING_RNG_AVAILABLE 888 # define OS_RNG_AVAILABLE 894 #endif // NO_OS_DEPENDENCE 898 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 900 #ifdef CRYPTOPP_EXPORTS 901 #define CRYPTOPP_IS_DLL 902 #define CRYPTOPP_DLL __declspec(dllexport) 903 #elif defined(CRYPTOPP_IMPORTS) 904 #define CRYPTOPP_IS_DLL 905 #define CRYPTOPP_DLL __declspec(dllimport) 911 #define CRYPTOPP_TABLE extern 912 #define CRYPTOPP_API __cdecl 914 #else // not CRYPTOPP_WIN32_AVAILABLE 917 #define CRYPTOPP_TABLE extern 921 #endif // CRYPTOPP_WIN32_AVAILABLE 923 #if defined(__MWERKS__) 924 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL 925 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC) 926 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL 928 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL 931 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS) 932 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL 934 #define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS 937 #if defined(__MWERKS__) 938 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class 939 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC) 940 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class 942 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class 945 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS) 946 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class 948 #define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS 955 #define CRYPTOPP_UNUSED(x) ((void)(x)) 959 #if (CRYPTOPP_GCC_VERSION >= 40500) || (CRYPTOPP_LLVM_CLANG_VERSION >= 20800) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40200) 960 # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated (msg))) 961 #elif (CRYPTOPP_GCC_VERSION) 962 # define CRYPTOPP_DEPRECATED(msg) __attribute__((deprecated)) 964 # define CRYPTOPP_DEPRECATED(msg) 970 #if (CRYPTOPP_LLVM_CLANG_VERSION >= 30700) || (CRYPTOPP_APPLE_CLANG_VERSION >= 70000) 971 # define CRYPTOPP_NO_SANITIZE(x) __attribute__((no_sanitize(x))) 973 # define CRYPTOPP_NO_SANITIZE(x) 985 #ifndef __has_feature 986 # define __has_feature(x) 0 989 #if !defined(CRYPTOPP_NO_CXX11) 990 # if ((_MSC_VER >= 1600) || (__cplusplus >= 201103L)) && !defined(_STLPORT_VERSION) 991 # define CRYPTOPP_CXX11 1 1000 #if defined(__APPLE__) && defined(__clang__) 1001 # if !(defined(__has_include) && __has_include(<forward_list>)) 1002 # undef CRYPTOPP_CXX11 1007 #if defined(CRYPTOPP_CXX11) 1010 #if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_atomic) || \ 1011 (__INTEL_COMPILER >= 1300) || (CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5140) 1012 # define CRYPTOPP_CXX11_ATOMICS 1 1017 #if (CRYPTOPP_MSC_VERSION >= 1700) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || \ 1018 (CRYPTOPP_APPLE_CLANG_VERSION >= 50000) || (__INTEL_COMPILER >= 1200) || \ 1019 (CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5130) 1026 # if !defined(__GLIBCXX__) || defined(_GLIBCXX_HAS_GTHREADS) 1027 # define CRYPTOPP_CXX11_SYNCHRONIZATION 1 1029 #endif // synchronization 1035 #if (CRYPTOPP_MSC_VERSION >= 1900) && ((WINVER >= 0x0600) || (_WIN32_WINNT >= 0x0600)) || \ 1036 (CRYPTOPP_LLVM_CLANG_VERSION >= 20900) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || \ 1037 (__INTEL_COMPILER >= 1110) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130) 1038 # define CRYPTOPP_CXX11_DYNAMIC_INIT 1 1039 #endif // Dynamic Initialization compilers 1042 #if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_alignas) || \ 1043 (__INTEL_COMPILER >= 1500) || (CRYPTOPP_GCC_VERSION >= 40800) || (__SUNPRO_CC >= 0x5130) 1044 # define CRYPTOPP_CXX11_ALIGNAS 1 1048 #if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_alignof) || \ 1049 (__INTEL_COMPILER >= 1500) || (CRYPTOPP_GCC_VERSION >= 40500) || (__SUNPRO_CC >= 0x5130) 1050 # define CRYPTOPP_CXX11_ALIGNOF 1 1054 #if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_lambdas) || \ 1055 (__INTEL_COMPILER >= 1200) || (CRYPTOPP_GCC_VERSION >= 40900) || (__SUNPRO_CC >= 0x5140) 1056 # define CRYPTOPP_CXX11_LAMBDA 1 1060 #if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_noexcept) || \ 1061 (__INTEL_COMPILER >= 1400) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130) 1062 # define CRYPTOPP_CXX11_NOEXCEPT 1 1063 #endif // noexcept compilers 1066 #if (CRYPTOPP_MSC_VERSION >= 1800) || __has_feature(cxx_variadic_templates) || \ 1067 (__INTEL_COMPILER >= 1210) || (CRYPTOPP_GCC_VERSION >= 40300) || (__SUNPRO_CC >= 0x5130) 1068 # define CRYPTOPP_CXX11_VARIADIC_TEMPLATES 1 1069 #endif // variadic templates 1073 #if (CRYPTOPP_MSC_VERSION >= 1900) || __has_feature(cxx_constexpr) || \ 1074 (__INTEL_COMPILER >= 1600) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130) 1075 # define CRYPTOPP_CXX11_CONSTEXPR 1 1076 #endif // constexpr compilers 1080 #if (CRYPTOPP_MSC_VERSION >= 1700) || __has_feature(cxx_strong_enums) || \ 1081 (__INTEL_COMPILER >= 1400) || (CRYPTOPP_GCC_VERSION >= 40400) || (__SUNPRO_CC >= 0x5120) 1082 # define CRYPTOPP_CXX11_ENUM 1 1083 #endif // constexpr compilers 1086 #if (CRYPTOPP_MSC_VERSION >= 1600) || __has_feature(cxx_nullptr) || \ 1087 (__INTEL_COMPILER >= 1000) || (CRYPTOPP_GCC_VERSION >= 40600) || (__SUNPRO_CC >= 0x5130) 1088 # define CRYPTOPP_CXX11_NULLPTR 1 1089 #endif // nullptr_t compilers 1091 #endif // CRYPTOPP_CXX11 1096 #if defined(CRYPTOPP_CXX11) && !defined(CRYPTOPP_NO_CXX17) 1097 # if ((_MSC_VER >= 1900) || (__cplusplus >= 201703L)) && !defined(_STLPORT_VERSION) 1098 # define CRYPTOPP_CXX17 1 1103 #if defined(CRYPTOPP_CXX17) 1107 #if defined(__clang__) 1108 # if __EXCEPTIONS && __has_feature(cxx_exceptions) 1109 # define CRYPTOPP_CXX17_EXCEPTIONS 1 1111 #elif (CRYPTOPP_MSC_VERSION >= 1900) || (__INTEL_COMPILER >= 1800) || (CRYPTOPP_GCC_VERSION >= 60000) 1112 # define CRYPTOPP_CXX17_EXCEPTIONS 1 1113 #endif // uncaught_exceptions compilers 1115 #endif // CRYPTOPP_CXX17 1119 #if defined(CRYPTOPP_CXX11_NOEXCEPT) 1120 # define CRYPTOPP_THROW noexcept(false) 1121 # define CRYPTOPP_NO_THROW noexcept(true) 1123 # define CRYPTOPP_THROW 1124 # define CRYPTOPP_NO_THROW 1125 #endif // CRYPTOPP_CXX11_NOEXCEPT 1128 #if defined(CRYPTOPP_CXX11_CONSTEXPR) 1129 # define CRYPTOPP_STATIC_CONSTEXPR static constexpr 1130 # define CRYPTOPP_CONSTEXPR constexpr 1132 # define CRYPTOPP_STATIC_CONSTEXPR static 1133 # define CRYPTOPP_CONSTEXPR 1134 #endif // CRYPTOPP_CXX11_CONSTEXPR 1137 #if defined(CRYPTOPP_CXX11_ALIGNAS) 1138 # undef CRYPTOPP_ALIGN_DATA 1139 # define CRYPTOPP_ALIGN_DATA(x) alignas(x) 1140 #endif // CRYPTOPP_CXX11_ALIGNAS 1151 #if defined(CRYPTOPP_CXX11_ENUM) 1152 # undef CRYPTOPP_CONSTANT 1153 # define CRYPTOPP_CONSTANT(x) enum : int { x }; 1154 #elif defined(CRYPTOPP_CXX11_CONSTEXPR) 1155 # undef CRYPTOPP_CONSTANT 1156 # define CRYPTOPP_CONSTANT(x) constexpr static int x; 1160 #if defined(CRYPTOPP_CXX11_NULLPTR) && !defined(NULLPTR) 1161 # define NULLPTR nullptr 1162 #elif !defined(NULLPTR) 1163 # define NULLPTR NULL 1164 #endif // CRYPTOPP_CXX11_NULLPTR 1168 #if (defined(__cplusplus) && (__cplusplus >= 199711L) && (__cplusplus < 201402L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE) 1169 # error "std::uncaught_exception is not available. This is likely a configuration error." 1172 #endif // CRYPTOPP_CONFIG_H Crypto++ library namespace.