Crypto++ 8.7
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
11NAMESPACE_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
18{
19public:
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
29class RIPEMD320 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 40, RIPEMD320>
30{
31public:
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
42class RIPEMD128 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 16, RIPEMD128>
43{
44public:
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
55class RIPEMD256 : public IteratedHashWithStaticTransform<word32, LittleEndian, 64, 32, RIPEMD256>
56{
57public:
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
63NAMESPACE_END
64
65#endif
Iterated hash with a static transformation function.
Definition: iterhash.h:182
RIPEMD-128 message digest.
Definition: ripemd.h:43
RIPEMD-160 message digest.
Definition: ripemd.h:18
RIPEMD-256 message digest.
Definition: ripemd.h:56
RIPEMD-320 message digest.
Definition: ripemd.h:30
unsigned int word32
32-bit unsigned datatype
Definition: config_int.h:62
Base classes for iterated hashes.
Crypto++ library namespace.
Converts an enumeration to a type suitable for use as a template parameter.
Definition: cryptlib.h:136