3 #define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES 4 #define CRYPTOPP_DEFAULT_NO_DLL 10 #if CRYPTOPP_MSC_VERSION 11 # pragma warning(disable: 4589) 14 #if CRYPTOPP_MSC_VERSION 15 # pragma warning(default: 4660) 18 #if defined(CRYPTOPP_EXPORTS) && defined(CRYPTOPP_WIN32_AVAILABLE) 22 #ifndef CRYPTOPP_IMPORTS 27 #if defined(CRYPTOPP_IS_DLL) 28 template<>
const byte PKCS_DigestDecoration<SHA1>::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14};
31 template<>
const byte PKCS_DigestDecoration<SHA224>::decoration[] = {0x30,0x2d,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x04,0x05,0x00,0x04,0x1c};
34 template<>
const byte PKCS_DigestDecoration<SHA256>::decoration[] = {0x30,0x31,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x01,0x05,0x00,0x04,0x20};
37 template<>
const byte PKCS_DigestDecoration<SHA384>::decoration[] = {0x30,0x41,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x02,0x05,0x00,0x04,0x30};
40 template<>
const byte PKCS_DigestDecoration<SHA512>::decoration[] = {0x30,0x51,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x03,0x05,0x00,0x04,0x40};
49 #endif // CRYPTOPP_IS_DLL 55 #ifdef CRYPTOPP_EXPORTS 59 using std::set_new_handler;
61 static PNew s_pNew = NULL;
62 static PDelete s_pDelete = NULL;
64 static void * New (
size_t size)
67 while ((p = malloc(size)) == NULL)
74 #pragma warning(disable: 4191) 76 static void SetNewAndDeleteFunctionPointers()
79 HMODULE hModule = NULL;
80 MEMORY_BASIC_INFORMATION mbi;
84 VirtualQuery(p, &mbi,
sizeof(mbi));
86 if (p >= (
char *)mbi.BaseAddress + mbi.RegionSize)
89 p = (
char *)mbi.BaseAddress + mbi.RegionSize;
91 if (!mbi.AllocationBase || mbi.AllocationBase == hModule)
94 hModule = HMODULE(mbi.AllocationBase);
98 pGetNewAndDelete(s_pNew, s_pDelete);
103 if (pSetNewAndDelete)
107 pSetNewAndDelete(s_pNew, s_pDelete, &set_new_handler);
114 hModule = GetModuleHandle(
"msvcrtd");
116 hModule = GetModuleHandle(
"msvcrt");
120 s_pNew = (
PNew)GetProcAddress(hModule,
"??2@YAPAXI@Z");
121 s_pDelete = (
PDelete)GetProcAddress(hModule,
"??3@YAXPAX@Z");
122 if (s_pNew && s_pDelete)
126 s_pNew = (
PNew)GetProcAddress(hModule,
"??2@YAPEAX_K@Z");
127 s_pDelete = (
PDelete)GetProcAddress(hModule,
"??3@YAXPEAX@Z");
128 if (s_pNew && s_pDelete)
132 OutputDebugString(
"Crypto++ DLL was not able to obtain new and delete function pointers.\n");
137 #pragma warning(default: 4191) 139 void *
operator new (
size_t size)
142 SetNewAndDeleteFunctionPointers();
147 void operator delete (
void * p)
152 void *
operator new [] (
size_t size)
154 return operator new (
size);
157 void operator delete [] (
void * p)
162 #endif // CRYPTOPP_EXPORTS void(CRYPTOPP_API * PSetNewAndDelete)(PNew, PDelete, PSetNewHandler)
#define NAMESPACE_BEGIN(x)
Library configuration file.
if(a.IndicesBefore(b, len, lenIndices))
void *(CRYPTOPP_API * PNew)(size_t)
void(CRYPTOPP_API * PDelete)(void *)
void(CRYPTOPP_API * PGetNewAndDelete)(PNew &, PDelete &)
void CallNewHandler()
Attempts to reclaim unused memory.
#define USING_NAMESPACE(x)
uint8_t const size_t const size
PKCS#1 decoration data structure.
Functions and definitions required for building the FIPS-140 DLL on Windows.