Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB

  1. #ifndef CRYPTOPP_MD2_H
  2. #define CRYPTOPP_MD2_H
  3. #include "cryptlib.h"
  4. #include "secblock.h"
  5. NAMESPACE_BEGIN(CryptoPP)
  6. namespace Weak1 {
  7. /// <a href="http://www.cryptolounge.org/wiki/MD2">MD2</a>
  8. class MD2 : public HashTransformation
  9. {
  10. public:
  11. MD2();
  12. void Update(const byte *input, size_t length);
  13. void TruncatedFinal(byte *hash, size_t size);
  14. unsigned int DigestSize() const {return DIGESTSIZE;}
  15. unsigned int BlockSize() const {return BLOCKSIZE;}
  16. static const char * StaticAlgorithmName() {return "MD2";}
  17. CRYPTOPP_CONSTANT(DIGESTSIZE = 16)
  18. CRYPTOPP_CONSTANT(BLOCKSIZE = 16)
  19. private:
  20. void Transform();
  21. void Init();
  22. SecByteBlock m_X, m_C, m_buf;
  23. unsigned int m_count;
  24. };
  25. }
  26. #if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1
  27. namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak
  28. #else
  29. using namespace Weak1; // import Weak1 into CryptoPP with warning
  30. #ifdef __GNUC__
  31. #warning "You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning."
  32. #else
  33. #pragma message("You may be using a weak algorithm that has been retained for backwards compatibility. Please '#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1' before including this .h file and prepend the class name with 'Weak::' to remove this warning.")
  34. #endif
  35. #endif
  36. NAMESPACE_END
  37. #endif