Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:10

0001 // tiger.h - originally written and placed in the public domain by Wei Dai

0002 
0003 /// \file tiger.h

0004 /// \brief Classes for the Tiger message digest

0005 /// \details Crypto++ provides the original Tiger hash that was

0006 ///  submitted to the NESSIE project. The implementation is different

0007 ///  from the revised Tiger2 hash.

0008 /// \sa <a href="https://www.cryptopp.com/wiki/Tiger">Tiger</a> and

0009 ///  <a href="http://www.cs.technion.ac.il/~biham/Reports/Tiger/">Tiger:

0010 ///  A Fast New Cryptographic Hash Function</a>

0011 /// \since Crypto++ 2.1

0012 
0013 #ifndef CRYPTOPP_TIGER_H
0014 #define CRYPTOPP_TIGER_H
0015 
0016 #include "config.h"
0017 #include "iterhash.h"
0018 
0019 // Clang 3.3 integrated assembler crash on Linux. Clang 3.4 due to compiler

0020 // error with .intel_syntax, http://llvm.org/bugs/show_bug.cgi?id=24232

0021 #if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_MIXED_ASM)
0022 # define CRYPTOPP_DISABLE_TIGER_ASM 1
0023 #endif
0024 
0025 NAMESPACE_BEGIN(CryptoPP)
0026 
0027 /// \brief Tiger message digest

0028 /// \details Crypto++ provides the original Tiger hash that was

0029 ///  submitted to the NESSIE project. The implementation is different

0030 ///  from the revised Tiger2 hash.

0031 /// \sa <a href="https://www.cryptopp.com/wiki/Tiger">Tiger</a> and

0032 ///  <a href="http://www.cs.technion.ac.il/~biham/Reports/Tiger/">Tiger:

0033 ///  A Fast New Cryptographic Hash Function</a>

0034 /// \since Crypto++ 2.1

0035 class Tiger : public IteratedHashWithStaticTransform<word64, LittleEndian, 64, 24, Tiger>
0036 {
0037 public:
0038     CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Tiger";}
0039     std::string AlgorithmProvider() const;
0040 
0041     /// \brief Initialize state array

0042     /// \param state the state of the hash

0043     static void InitState(HashWordType *state);
0044     /// \brief Operate the hash

0045     /// \param digest the state of the hash

0046     /// \param data the data to be digested

0047     static void Transform(word64 *digest, const word64 *data);
0048     /// \brief Computes the hash of the current message

0049     /// \param digest a pointer to the buffer to receive the hash

0050     /// \param digestSize the size of the truncated digest, in bytes

0051     /// \details TruncatedFinal() calls Final() and then copies digestSize bytes to digest.

0052     ///   The hash is restarted the hash for the next message.

0053     void TruncatedFinal(byte *digest, size_t digestSize);
0054 
0055 protected:
0056     static const word64 table[4*256+3];
0057 };
0058 
0059 NAMESPACE_END
0060 
0061 #endif