#ifndef CRYPTOPP_MISC_H #define CRYPTOPP_MISC_H #include "config.h" #if !defined(_UEFI) #include // for memcpy and memmove #ifndef _WIN32 #include // for strcasecmp #define _stricmp strcasecmp #endif #else #include "Tcdefs.h" #endif // !defined(_UEFI) #ifdef __cplusplus extern "C" { #endif #if defined(_MSC_VER) && !defined(_UEFI) #if _MSC_VER >= 1400 #if !defined(TC_WINDOWS_DRIVER) && !defined(_UEFI) // VC2005 workaround: disable declarations that conflict with winnt.h #define _interlockedbittestandset CRYPTOPP_DISABLED_INTRINSIC_1 #define _interlockedbittestandreset CRYPTOPP_DISABLED_INTRINSIC_2 #define _interlockedbittestandset64 CRYPTOPP_DISABLED_INTRINSIC_3 #define _interlockedbittestandreset64 CRYPTOPP_DISABLED_INTRINSIC_4 #include #undef _interlockedbittestandset #undef _interlockedbittestandreset #undef _interlockedbittestandset64 #undef _interlockedbittestandreset64 #endif #define CRYPTOPP_FAST_ROTATE(x) 1 #elif !defined(_UEFI) && _MSC_VER >= 1300 #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32 | (x) == 64) #else #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32) #endif #elif (defined(__MWERKS__) && TARGET_CPU_PPC) || \ (defined(__GNUC__) && (defined(_ARCH_PWR2) || defined(_ARCH_PWR) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || defined(_ARCH_COM))) #define CRYPTOPP_FAST_ROTATE(x) ((x) == 32) #elif defined(__GNUC__) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86) // depend on GCC's peephole optimization to generate rotate instructions #define CRYPTOPP_FAST_ROTATE(x) 1 #else #define CRYPTOPP_FAST_ROTATE(x) 0 #endif #if defined( _MSC_VER ) && ( _MSC_VER > 800 ) && !defined(_UEFI) #pragma intrinsic(memcpy,memset) #endif #if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER) // Intel C++ Compiler 10.0 calls a function instead of using the rotate instruction when using these instructions #pragma intrinsic(_rotr,_rotl,_rotr64,_rotl64) #define rotr32(x,n) _rotr(x, n) #define rotl32(x,n) _rotl(x, n) #define rotr64(x,n) _rotr64(x, n) #define rotl64(x,n) _rotl64(x, n) #else #define rotr32(x,n) (((x) >> n) | ((x) << (32 - n))) #define rotl32(x,n) (((x) << n) | ((x) >> (32 - n))) #define rotr64(x,n) (((x) >> n) | ((x) << (64 - n))) #define rotl64(x,n) (((x) << n) | ((x) >> (64 - n))) #endif #if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER) // Intel C++ Compiler 10.0 calls a function instead of using the rotate instruction when using these instructions #pragma intrinsic(_rotr8,_rotl8,_rotr16,_rotl16) #define rotr8(x,n) _rotr8(x, n) #define rotl8(x,n) _rotl8(x, n) #define rotr16(x,n) _rotr16(x, n) #define rotl16(x,n) _rotl16(x, n) #else #define rotr8(x,n) (((x) >> n) | ((x) << (8 - n))) #define rotl8(x,n) (((x) << n) | ((x) >> (8 - n))) #define rotr16(x,n) (((x) >> n) | ((x) << (16 - n))) #define rotl16(x,n) (((x) << n) | ((x) >> (16 - n))) #endif #if defined(__GNUC__) && defined(__linux__) #define CRYPTOPP_BYTESWAP_AVAILABLE #include #elif defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_UEFI) #pragma intrinsic(_byteswap_ulong,_byteswap_uint64) #define CRYPTOPP_BYTESWAP_AVAILABLE #define bswap_32(x) _byteswap_ulong(x) #define bswap_64(x) _byteswap_uint64(x) #elif defined(__APPLE__) #include #define CRYPTOPP_BYTESWAP_AVAILABLE #define bswap_16 OSSwapInt16 #define bswap_32 OSSwapInt32 #define bswap_64 OSSwapInt64 #else #if CRYPTOPP_FAST_ROTATE(32) #define bswap_32(x) (rotr32((x), 8U) & 0xff00ff00) | (rotl32((x), 8U) & 0x00ff00ff) #else #define CRYPTOPP_BYTESWAP_AVAILABLE #define bswap_32(x) (rotl32((((x) & 0xFF00FF00) >> 8) | (((x) & 0x00FF00FF) << 8), 16U)) #define bswap_64(x) rotl64(((((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0xFFFF0000FFFF0000)) >> 16) | (((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0x0000FFFF0000FFFF)) << 16)), 32U) #endif #ifndef TC_NO_COMPILER_INT64 #define bswap_64(x) rotl64(((((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0xFFFF0000FFFF0000)) >> 16) | (((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0x0000FFFF0000FFFF)) << 16)), 32U) #endif #endif VC_INLINE uint32 ByteReverseWord32 (uint32 value) { #if defined(__GNUC__) && defined(CRYPTOPP_X86_ASM_AVAILABLE) __asm__ ("bswap %0" : "=r" (value) : "0" (value)); return value; #elif defined(CRYPTOPP_BYTESWAP_AVAILABLE) return bswap_32(value); #elif defined(__MWERKS__) && TARGET_CPU_PPC return (uint32)__lwbrx(&value,0); #elif _MSC_VER >= 1400 || (_MSC_VER >= 1300 && !defined(_DLL)) return _byteswap_ulong(value); #elif CRYPTOPP_FAST_ROTATE(32) // 5 instructions with rotate instruction, 9 without return (rotr32(value, 8U) & 0xff00ff00) | (rotl32(value, 8U) & 0x00ff00ff); #else // 6 instructions with rotate instruction, 8 without value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); return rotl32(value, 16U); #endif } #ifndef TC_NO_COMPILER_INT64 VC_INLINE uint64 ByteReverseWord64(uint64 value) { #if defined(__GNUC__) && defined(CRYPTOPP_X86_ASM_AVAILABLE) && defined(__x86_64__) __asm__ ("bswap %0" : "=r" (value) : "0" (value)); return value; #elif defined(CRYPTOPP_BYTESWAP_AVAILABLE) return bswap_64(value); #elif defined(_MSC_VER) && _MSC_VER >= 1300 return _byteswap_uint64(value); #else value = ((value & LL(0xFF00FF00FF00FF00)) >> 8) | ((value & LL(0x00FF00FF00FF00FF)) << 8); value = ((value & LL(0xFFFF0000FFFF0000)) >> 16) | ((value & LL(0x0000FFFF0000FFFF)) << 16); return rotl64(value, 32U); #endif } VC_INLINE void CorrectEndianess(uint64 *out, const uint64 *in, size_t byteCount) { size_t i, count = byteCount/sizeof(uint64); for (i=0; i= 1300) #define GetAlignmentOf(T) __alignof(T) #elif defined(__GNUC__) #define GetAlignmentOf(T) __alignof__(T) #else #define GetAlignmentOf(T) sizeof(T) #endif #define IsPowerOf2(n) (((n) > 0) && (((n) & ((n)-1)) == 0)) #define ModPowerOf2(a,b) ((a) & ((b)-1)) #define IsAlignedOn(p,alignment) ((alignment==1) || (IsPowerOf2(alignment) ? ModPowerOf2((size_t)p, alignment) == 0 : (size_t)p % alignment == 0)) #define IsAligned16(p) IsAlignedOn(p, GetAlignmentOf(uint64)) #ifdef __cplusplus } #endif #endif .Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Setup.rc
//
#define IDR_COMREG                      10
#define IDD_INSTALL                     101
#define IDD_INSTALL_OPTIONS_PAGE_DLG    102
#define IDD_UNINSTALL                   103
#define IDI_SETUP                       104
#define IDR_SETUP_RSRC_HEADER           105
#define IDD_EXTRACTION_OPTIONS_PAGE_DLG 106
#define IDB_SETUP_WIZARD                107
#define IDD_INTRO_PAGE_DLG              108
#define IDB_SETUP_WIZARD_BKG            109
#define IDD_INFO_PAGE_DLG               110
#define IDD_INSTL_DLG                   111
#define IDD_WIZARD_MODE_PAGE_DLG        112
#define IDD_PROGRESS_PAGE_DLG           113
#define IDD_DONATIONS_PAGE_DLG          114
#define IDC_DESTINATION                 1000
#define IDC_BOX_TITLE                   1001
#define IDC_BROWSE                      1002
#define IDC_BOX_INFO                    1003
#define IDC_LICENSE                     1004
#define IDC_BOX_HELP                    1005
#define IDC_LICENSE_TEXT                1006
#define IDC_BOX_HELP2                   1007
#define IDC_FILE_TYPE                   1008
#define IDT_UNINSTALL_DIR               1009
#define IDC_PROG_GROUP                  1010
#define IDC_SYSTEM_RESTORE              1011
#define IDC_DESKTOP_ICON                1012
#define IDC_ALL_USERS                   1013
#define IDT_INSTALL_DESTINATION         1014
#define IDC_UNINSTALL                   1015
#define IDC_PROGRESS_BAR                1016
#define IDC_LOG_WINDOW                  1017
#define IDC_SETUP_WIZARD_BKG            1018
#define IDC_SETUP_WIZARD_GFX_AREA       1019
#define IDC_HR                          1020
#define IDC_OPEN_CONTAINING_FOLDER      1021
#define IDC_AGREE                       1022
#define IDC_HR_BOTTOM                   1023
#define IDC_WIZARD_MODE_INSTALL         1024
#define IDC_WIZARD_MODE_EXTRACT_ONLY    1025
#define IDC_NEXT                        1026
#define IDC_PREV                        1027
#define IDT_EXTRACT_DESTINATION         1028
#define IDC_POS_BOX                     1029
#define IDC_BITMAP_SETUP_WIZARD         1030
#define IDC_MAIN_CONTENT_CANVAS         1031
#define IDC_DONATE                      1032

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC                     1
#define _APS_NEXT_RESOURCE_VALUE        115
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1033
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif