File indexing completed on 2025-01-18 09:55:04
0001
0002
0003
0004
0005
0006
0007 #ifndef CRYPTOPP_MD2_H
0008 #define CRYPTOPP_MD2_H
0009
0010 #include "cryptlib.h"
0011 #include "secblock.h"
0012
0013 NAMESPACE_BEGIN(CryptoPP)
0014
0015 namespace Weak1 {
0016
0017
0018
0019
0020 class MD2 : public HashTransformation
0021 {
0022 public:
0023 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MD2";}
0024
0025 MD2();
0026 void Update(const byte *input, size_t length);
0027 void TruncatedFinal(byte *hash, size_t size);
0028 unsigned int DigestSize() const {return DIGESTSIZE;}
0029 unsigned int BlockSize() const {return BLOCKSIZE;}
0030 std::string AlgorithmName() const {return StaticAlgorithmName();}
0031
0032 CRYPTOPP_CONSTANT(DIGESTSIZE = 16);
0033 CRYPTOPP_CONSTANT(BLOCKSIZE = 16);
0034
0035 private:
0036 void Transform();
0037 void Init();
0038 SecByteBlock m_X, m_C, m_buf;
0039 unsigned int m_count;
0040 };
0041
0042 }
0043 #if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1
0044 namespace Weak {using namespace Weak1;}
0045 #else
0046 using namespace Weak1;
0047 #ifdef __GNUC__
0048 #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."
0049 #else
0050 #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.")
0051 #endif
0052 #endif
0053
0054 NAMESPACE_END
0055
0056 #endif