Crypto++  5.6.5
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 //! \class RIPEMD160
14 //! \brief RIPEMD-160 message digest
15 //! \details Digest size is 160-bits.
16 //! \sa <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-160">RIPEMD-160</a>
18 {
19 public:
20  static void InitState(HashWordType *state);
21  static void Transform(word32 *digest, const word32 *data);
22  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RIPEMD-160";}
23 };
24 
25 //! \class RIPEMD320
26 //! \brief RIPEMD-320 message digest
27 //! \details Digest size is 320-bits.
28 //! \sa <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-320">RIPEMD-320</a>
29 class RIPEMD320 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 40, RIPEMD320>
30 {
31 public:
32  static void InitState(HashWordType *state);
33  static void Transform(word32 *digest, const word32 *data);
34  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RIPEMD-320";}
35 };
36 
37 //! \class RIPEMD128
38 //! \brief RIPEMD-128 message digest
39 //! \details Digest size is 128-bits.
40 //! \warning RIPEMD-128 is considered insecure, and should not be used unless you absolutely need it for compatibility.
41 //! \sa <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-128">RIPEMD-128</a>
42 class RIPEMD128 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 16, RIPEMD128>
43 {
44 public:
45  static void InitState(HashWordType *state);
46  static void Transform(word32 *digest, const word32 *data);
47  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RIPEMD-128";}
48 };
49 
50 //! \class RIPEMD256
51 //! \brief RIPEMD-256 message digest
52 //! \details Digest size is 256-bits.
53 //! \warning RIPEMD-256 is considered insecure, and should not be used unless you absolutely need it for compatibility.
54 //! \sa <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-256">RIPEMD-256</a>
55 class RIPEMD256 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 32, RIPEMD256>
56 {
57 public:
58  static void InitState(HashWordType *state);
59  static void Transform(word32 *digest, const word32 *data);
60  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RIPEMD-256";}
61 };
62 
63 NAMESPACE_END
64 
65 #endif
Iterated hash with a static transformation function.
Definition: iterhash.h:150
Converts an enumeration to a type suitable for use as a template parameter.
Definition: cryptlib.h:116
RIPEMD-160 message digest.
Definition: ripemd.h:17
RIPEMD-256 message digest.
Definition: ripemd.h:55
RIPEMD-320 message digest.
Definition: ripemd.h:29
Crypto++ library namespace.
RIPEMD-128 message digest.
Definition: ripemd.h:42