Security Scol plugin
md2.h
Go to the documentation of this file.
1// md2.h - originally written and placed in the public domain by Wei Dai
2
6
7#ifndef CRYPTOPP_MD2_H
8#define CRYPTOPP_MD2_H
9
10#include "cryptlib.h"
11#include "secblock.h"
12
13NAMESPACE_BEGIN(CryptoPP)
14
15namespace Weak1 {
16
20class MD2 : public HashTransformation
21{
22public:
23 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MD2";}
24
25 MD2();
26 void Update(const byte *input, size_t length);
27 void TruncatedFinal(byte *hash, size_t size);
28 unsigned int DigestSize() const {return DIGESTSIZE;}
29 unsigned int BlockSize() const {return BLOCKSIZE;}
30 std::string AlgorithmName() const {return StaticAlgorithmName();}
31
32 CRYPTOPP_CONSTANT(DIGESTSIZE = 16);
33 CRYPTOPP_CONSTANT(BLOCKSIZE = 16);
34
35private:
36 void Transform();
37 void Init();
38 SecByteBlock m_X, m_C, m_buf;
39 unsigned int m_count;
40};
41
42}
43#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1
44namespace Weak {using namespace Weak1;} // import Weak1 into CryptoPP::Weak
45#else
46using namespace Weak1; // import Weak1 into CryptoPP with warning
47#ifdef __GNUC__
48#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."
49#else
50#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.")
51#endif
52#endif
53
54NAMESPACE_END
55
56#endif
Interface for hash functions and data processing part of MACs.
Definition cryptlib.h:1113
MD2 message digest.
Definition md2.h:21
unsigned int BlockSize() const
Provides the block size of the compression function.
Definition md2.h:29
unsigned int DigestSize() const
Definition md2.h:28
std::string AlgorithmName() const
Provides the name of this algorithm.
Definition md2.h:30
void Update(const byte *input, size_t length)
Updates a hash with additional input.
Definition md2.cpp:38
void TruncatedFinal(byte *hash, size_t size)
Computes the hash of the current message.
Definition md2.cpp:102
Abstract base classes that provide a uniform interface to this library.
Classes and functions for secure memory allocations.