Coverage Report

Created: 2024-11-21 07:03

/src/cryptopp/whrlpool.h
Line
Count
Source
1
// whrlpool.h - originally modified by Kevin Springle from Paulo Barreto and Vincent Rijmen's
2
//              public domain code, whirlpool.c. Updated to Whirlpool version 3.0, optimized
3
//              and SSE version added by WD. All modifications are placed in the public domain.
4
5
#ifndef CRYPTOPP_WHIRLPOOL_H
6
#define CRYPTOPP_WHIRLPOOL_H
7
8
/// \file whrlpool.h
9
/// \brief Classes for the Whirlpool message digest
10
/// \details Crypto++ provides version 3.0 of the Whirlpool algorithm.
11
///   This version of the algorithm was submitted for ISO standardization.
12
13
#include "config.h"
14
#include "iterhash.h"
15
16
// Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler
17
// error with .intel_syntax, http://llvm.org/bugs/show_bug.cgi?id=24232
18
#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_MIXED_ASM)
19
# define CRYPTOPP_DISABLE_WHIRLPOOL_ASM 1
20
#endif
21
22
NAMESPACE_BEGIN(CryptoPP)
23
24
/// \brief Whirlpool message digest
25
/// \details Crypto++ provides version 3.0 of the Whirlpool algorithm.
26
///   This version of the algorithm was submitted for ISO standardization.
27
/// \since Crypto++ 5.2
28
/// \sa <a href="http://www.cryptopp.com/wiki/Whirlpool">Whirlpool</a>
29
class Whirlpool : public IteratedHashWithStaticTransform<word64, BigEndian, 64, 64, Whirlpool>
30
{
31
public:
32
40
  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Whirlpool";}
33
  std::string AlgorithmProvider() const;
34
35
  static void InitState(HashWordType *state);
36
  static void Transform(word64 *digest, const word64 *data);
37
  void TruncatedFinal(byte *hash, size_t size);
38
};
39
40
NAMESPACE_END
41
42
#endif