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 26 template<> const byte
PKCS_DigestDecoration<
SHA1>::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14};
29 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};
32 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};
35 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};
38 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};
51 #ifdef CRYPTOPP_EXPORTS 55 #if !(defined(_MSC_VER) && (_MSC_VER < 1300)) 56 using std::set_new_handler;
59 static PNew s_pNew = NULL;
60 static PDelete s_pDelete = NULL;
62 static void * New (
size_t size)
65 while ((p = malloc(size)) == NULL)
72 #pragma warning(disable: 4191) 74 static void SetNewAndDeleteFunctionPointers()
77 HMODULE hModule = NULL;
78 MEMORY_BASIC_INFORMATION mbi;
82 VirtualQuery(p, &mbi,
sizeof(mbi));
84 if (p >= (
char *)mbi.BaseAddress + mbi.RegionSize)
87 p = (
char *)mbi.BaseAddress + mbi.RegionSize;
89 if (!mbi.AllocationBase || mbi.AllocationBase == hModule)
92 hModule = HMODULE(mbi.AllocationBase);
93 PGetNewAndDelete pGetNewAndDelete = (PGetNewAndDelete)GetProcAddress(hModule,
"GetNewAndDeleteForCryptoPP");
96 pGetNewAndDelete(s_pNew, s_pDelete);
100 PSetNewAndDelete pSetNewAndDelete = (PSetNewAndDelete)GetProcAddress(hModule,
"SetNewAndDeleteFromCryptoPP");
101 if (pSetNewAndDelete)
105 pSetNewAndDelete(s_pNew, s_pDelete, &set_new_handler);
112 hModule = GetModuleHandle(
"msvcrtd");
114 hModule = GetModuleHandle(
"msvcrt");
118 s_pNew = (PNew)GetProcAddress(hModule,
"??2@YAPAXI@Z");
119 s_pDelete = (PDelete)GetProcAddress(hModule,
"??3@YAXPAX@Z");
120 if (s_pNew && s_pDelete)
124 s_pNew = (PNew)GetProcAddress(hModule,
"??2@YAPEAX_K@Z");
125 s_pDelete = (PDelete)GetProcAddress(hModule,
"??3@YAXPEAX@Z");
126 if (s_pNew && s_pDelete)
130 OutputDebugString(
"Crypto++ was not able to obtain new and delete function pointers.\n");
135 #pragma warning(default: 4191) 137 void *
operator new (
size_t size)
140 SetNewAndDeleteFunctionPointers();
145 void operator delete (
void * p)
150 void *
operator new [] (
size_t size)
152 return operator new (size);
155 void operator delete [] (
void * p)
160 #endif // #ifdef CRYPTOPP_EXPORTS Library configuration file.
void CallNewHandler()
Attempts to reclaim unused memory.
Crypto++ library namespace.
Functions and definitions required for building the FIPS-140 DLL on Windows.