Crypto++  5.6.4
Free C++ class library of cryptographic schemes
ripemd.h
Go to the documentation of this file.
1 // ripemd.h - written and placed in the public domain by Wei Dai
2 
3 //! \file
4 //! \brief Classes for RIPEMD message digest
5 
6 #ifndef CRYPTOPP_RIPEMD_H
7 #define CRYPTOPP_RIPEMD_H
8 
9 #include "iterhash.h"
10 
11 NAMESPACE_BEGIN(CryptoPP)
12 
13 //! <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-160">RIPEMD-160</a>
14 /*! Digest Length = 160 bits */
16 {
17 public:
18  static void InitState(HashWordType *state);
19  static void Transform(word32 *digest, const word32 *data);
20  CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "RIPEMD-160";}
21 };
22 
23 /*! Digest Length = 320 bits, Security is similar to RIPEMD-160 */
24 class RIPEMD320 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 40, RIPEMD320>
25 {
26 public:
27  static void InitState(HashWordType *state);
28  static void Transform(word32 *digest, const word32 *data);
29  CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "RIPEMD-320";}
30 };
31 
32 /*! \warning RIPEMD-128 is considered insecure, and should not be used
33  unless you absolutely need it for compatibility. */
34 class RIPEMD128 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 16, RIPEMD128>
35 {
36 public:
37  static void InitState(HashWordType *state);
38  static void Transform(word32 *digest, const word32 *data);
39  CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "RIPEMD-128";}
40 };
41 
42 /*! \warning RIPEMD-256 is considered insecure, and should not be used
43  unless you absolutely need it for compatibility. */
44 class RIPEMD256 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 32, RIPEMD256>
45 {
46 public:
47  static void InitState(HashWordType *state);
48  static void Transform(word32 *digest, const word32 *data);
49  CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "RIPEMD-256";}
50 };
51 
52 NAMESPACE_END
53 
54 #endif
Iterated hash with a static transformation function.
Definition: iterhash.h:152
Converts a typename to an enumerated value.
Definition: cryptlib.h:120
RIPEMD-160
Definition: ripemd.h:15
Crypto++ library namespace.