Crypto++ 8.4 Free C++ class library of cryptographic schemes

ripemd.h
Go to the documentation of this file.
1 // ripemd.h - originally 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 /// \brief RIPEMD-160 message digest
14 /// \details Digest size is 160-bits.
15 /// \sa <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-160">RIPEMD-160</a>
16 /// \since Crypto++ 2.1
17 class RIPEMD160 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 20, RIPEMD160>
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 /// \brief RIPEMD-320 message digest
26 /// \details Digest size is 320-bits.
27 /// \sa <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-320">RIPEMD-320</a>
28 /// \since Crypto++ 2.1
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 /// \brief RIPEMD-128 message digest
38 /// \details Digest size is 128-bits.
39 /// \warning RIPEMD-128 is considered insecure, and should not be used unless you absolutely need it for compatibility.
40 /// \sa <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-128">RIPEMD-128</a>
41 /// \since Crypto++ 2.1
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 /// \brief RIPEMD-256 message digest
51 /// \details Digest size is 256-bits.
52 /// \warning RIPEMD-256 is considered insecure, and should not be used unless you absolutely need it for compatibility.
53 /// \sa <a href="http://www.weidai.com/scan-mirror/md.html#RIPEMD-256">RIPEMD-256</a>
54 /// \since Crypto++ 2.1
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
RIPEMD128
RIPEMD-128 message digest.
Definition: ripemd.h:42
EnumToType
Converts an enumeration to a type suitable for use as a template parameter.
Definition: cryptlib.h:135
iterhash.h
Base classes for iterated hashes.
word32
unsigned int word32
32-bit unsigned datatype
Definition: config_int.h:62
RIPEMD160
RIPEMD-160 message digest.
Definition: ripemd.h:17
RIPEMD256
RIPEMD-256 message digest.
Definition: ripemd.h:55
RIPEMD320
RIPEMD-320 message digest.
Definition: ripemd.h:29
CryptoPP
Crypto++ library namespace.
IteratedHashWithStaticTransform
Iterated hash with a static transformation function.
Definition: iterhash.h:180