whrlpool.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #ifndef CRYPTOPP_WHIRLPOOL_H
  5. #define CRYPTOPP_WHIRLPOOL_H
  6. /// \file whrlpool.h
  7. /// \brief Classes for the Whirlpool message digest
  8. /// \details Crypto++ provides version 3.0 of the Whirlpool algorithm.
  9. /// This version of the algorithm was submitted for ISO standardization.
  10. #include "config.h"
  11. #include "iterhash.h"
  12. // Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler
  13. // error with .intel_syntax, http://llvm.org/bugs/show_bug.cgi?id=24232
  14. #if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_MIXED_ASM)
  15. # define CRYPTOPP_DISABLE_WHIRLPOOL_ASM 1
  16. #endif
  17. NAMESPACE_BEGIN(CryptoPP)
  18. /// \brief Whirlpool message digest
  19. /// \details Crypto++ provides version 3.0 of the Whirlpool algorithm.
  20. /// This version of the algorithm was submitted for ISO standardization.
  21. /// \since Crypto++ 5.2
  22. /// \sa <a href="http://www.cryptopp.com/wiki/Whirlpool">Whirlpool</a>
  23. class Whirlpool : public IteratedHashWithStaticTransform<word64, BigEndian, 64, 64, Whirlpool>
  24. {
  25. public:
  26. CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Whirlpool";}
  27. std::string AlgorithmProvider() const;
  28. static void InitState(HashWordType *state);
  29. static void Transform(word64 *digest, const word64 *data);
  30. void TruncatedFinal(byte *hash, size_t size);
  31. };
  32. NAMESPACE_END
  33. #endif