~zooko/cryptopp/trunk

1 by weidai
Initial revision
1
#ifndef CRYPTOPP_MD4_H
2
#define CRYPTOPP_MD4_H
3
4
#include "iterhash.h"
5
6
NAMESPACE_BEGIN(CryptoPP)
7
313 by weidai
use Weak1 namespace
8
namespace Weak1 {
267 by weidai
move MD2, MD4, MD5, PanamaHash, WAKE_CFB into the namespace 'Weak'
9
1 by weidai
Initial revision
10
//! <a href="http://www.weidai.com/scan-mirror/md.html#MD4">MD4</a>
11
/*! \warning MD4 is considered insecure, and should not be used
179 by weidai
changes related to the next FIPS validation
12
	unless you absolutely need it for compatibility. */
75 by weidai
create DLL version, fix GetNextIV() bug in CTR and OFB modes
13
class MD4 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 16, MD4>
1 by weidai
Initial revision
14
{
15
public:
75 by weidai
create DLL version, fix GetNextIV() bug in CTR and OFB modes
16
	static void InitState(HashWordType *state);
1 by weidai
Initial revision
17
	static void Transform(word32 *digest, const word32 *data);
18
	static const char *StaticAlgorithmName() {return "MD4";}
19
};
20
267 by weidai
move MD2, MD4, MD5, PanamaHash, WAKE_CFB into the namespace 'Weak'
21
}
313 by weidai
use Weak1 namespace
22
#if CRYPTOPP_ENABLE_NAMESPACE_WEAK >= 1
23
namespace Weak {using namespace Weak1;}		// import Weak1 into CryptoPP::Weak
24
#else
25
using namespace Weak1;	// import Weak1 into CryptoPP with warning
267 by weidai
move MD2, MD4, MD5, PanamaHash, WAKE_CFB into the namespace 'Weak'
26
#ifdef __GNUC__
313 by weidai
use Weak1 namespace
27
#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."
267 by weidai
move MD2, MD4, MD5, PanamaHash, WAKE_CFB into the namespace 'Weak'
28
#else
313 by weidai
use Weak1 namespace
29
#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.")
267 by weidai
move MD2, MD4, MD5, PanamaHash, WAKE_CFB into the namespace 'Weak'
30
#endif
31
#endif
32
1 by weidai
Initial revision
33
NAMESPACE_END
34
35
#endif