dll.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // dll.h - originally written and placed in the public domain by Wei Dai
  2. /// \file dll.h
  3. /// \brief Functions and definitions required for building the FIPS-140 DLL on Windows
  4. #ifndef CRYPTOPP_DLL_H
  5. #define CRYPTOPP_DLL_H
  6. #if !defined(CRYPTOPP_IMPORTS) && !defined(CRYPTOPP_EXPORTS) && !defined(CRYPTOPP_DEFAULT_NO_DLL)
  7. #ifdef CRYPTOPP_CONFIG_H
  8. #error To use the DLL version of Crypto++, this file must be included before any other Crypto++ header files.
  9. #endif
  10. #define CRYPTOPP_IMPORTS
  11. #endif
  12. #include "aes.h"
  13. #include "cbcmac.h"
  14. #include "ccm.h"
  15. #include "cmac.h"
  16. #include "channels.h"
  17. #include "des.h"
  18. #include "dh.h"
  19. #include "dsa.h"
  20. #include "ec2n.h"
  21. #include "eccrypto.h"
  22. #include "ecp.h"
  23. #include "files.h"
  24. #include "fips140.h"
  25. #include "gcm.h"
  26. #include "hex.h"
  27. #include "hmac.h"
  28. #include "modes.h"
  29. #include "mqueue.h"
  30. #include "nbtheory.h"
  31. #include "osrng.h"
  32. #include "pkcspad.h"
  33. #include "pssr.h"
  34. #include "randpool.h"
  35. #include "rsa.h"
  36. #include "rw.h"
  37. #include "sha.h"
  38. #include "skipjack.h"
  39. #ifdef CRYPTOPP_IMPORTS
  40. #ifdef _DLL
  41. // cause CRT DLL to be initialized before Crypto++ so that we can use malloc and free during DllMain()
  42. #ifdef CRYPTOPP_DEBUG
  43. # pragma comment(lib, "msvcrtd")
  44. # pragma comment(lib, "cryptopp")
  45. #else
  46. # pragma comment(lib, "msvcrt")
  47. # pragma comment(lib, "cryptopp")
  48. #endif
  49. #endif
  50. #endif // #ifdef CRYPTOPP_IMPORTS
  51. #include <new> // for new_handler
  52. NAMESPACE_BEGIN(CryptoPP)
  53. typedef void * (CRYPTOPP_API * PNew)(size_t);
  54. typedef void (CRYPTOPP_API * PDelete)(void *);
  55. typedef void (CRYPTOPP_API * PGetNewAndDelete)(PNew &, PDelete &);
  56. typedef std::new_handler (CRYPTOPP_API * PSetNewHandler)(std::new_handler);
  57. typedef void (CRYPTOPP_API * PSetNewAndDelete)(PNew, PDelete, PSetNewHandler);
  58. NAMESPACE_END
  59. #endif