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 #if !(defined(_MSC_VER) && (_MSC_VER < 1300)) 60 using std::set_new_handler;
63 static PNew s_pNew = NULL;
64 static PDelete s_pDelete = NULL;
66 static void * New (
size_t size)
69 while ((p = malloc(size)) == NULL)
76 #pragma warning(disable: 4191) 78 static void SetNewAndDeleteFunctionPointers()
81 HMODULE hModule = NULL;
82 MEMORY_BASIC_INFORMATION mbi;
86 VirtualQuery(p, &mbi,
sizeof(mbi));
88 if (p >= (
char *)mbi.BaseAddress + mbi.RegionSize)
91 p = (
char *)mbi.BaseAddress + mbi.RegionSize;
93 if (!mbi.AllocationBase || mbi.AllocationBase == hModule)
96 hModule = HMODULE(mbi.AllocationBase);
97 PGetNewAndDelete pGetNewAndDelete = (PGetNewAndDelete)GetProcAddress(hModule,
"GetNewAndDeleteForCryptoPP");
100 pGetNewAndDelete(s_pNew, s_pDelete);
104 PSetNewAndDelete pSetNewAndDelete = (PSetNewAndDelete)GetProcAddress(hModule,
"SetNewAndDeleteFromCryptoPP");
105 if (pSetNewAndDelete)
109 pSetNewAndDelete(s_pNew, s_pDelete, &set_new_handler);
116 hModule = GetModuleHandle(
"msvcrtd");
118 hModule = GetModuleHandle(
"msvcrt");
122 s_pNew = (PNew)GetProcAddress(hModule,
"??2@YAPAXI@Z");
123 s_pDelete = (PDelete)GetProcAddress(hModule,
"??3@YAXPAX@Z");
124 if (s_pNew && s_pDelete)
128 s_pNew = (PNew)GetProcAddress(hModule,
"??2@YAPEAX_K@Z");
129 s_pDelete = (PDelete)GetProcAddress(hModule,
"??3@YAXPEAX@Z");
130 if (s_pNew && s_pDelete)
134 OutputDebugString(
"Crypto++ DLL was not able to obtain new and delete function pointers.\n");
139 #pragma warning(default: 4191) 141 void *
operator new (
size_t size)
144 SetNewAndDeleteFunctionPointers();
149 void operator delete (
void * p)
154 void *
operator new [] (
size_t size)
156 return operator new (size);
159 void operator delete [] (
void * p)
164 #endif // #ifdef CRYPTOPP_EXPORTS Library configuration file.
void CallNewHandler()
Attempts to reclaim unused memory.
PKCS#1 decoration data structure.
Crypto++ library namespace.
Functions and definitions required for building the FIPS-140 DLL on Windows.