directory re-organization (keeps the old build system)
[novacoin.git] / src / cryptopp / iterhash.h
1 #ifndef CRYPTOPP_ITERHASH_H
2 #define CRYPTOPP_ITERHASH_H
3
4 #include "secblock.h"
5
6 NAMESPACE_BEGIN(CryptoPP)
7
8 // *** trimmed down dependency from iterhash.h ***
9 template <class T_HashWordType, class T_Endianness, unsigned int T_BlockSize, unsigned int T_StateSize, class T_Transform, unsigned int T_DigestSize = 0, bool T_StateAligned = false>
10 class CRYPTOPP_NO_VTABLE IteratedHashWithStaticTransform
11 {
12 public:
13         CRYPTOPP_CONSTANT(DIGESTSIZE = T_DigestSize ? T_DigestSize : T_StateSize)
14         unsigned int DigestSize() const {return DIGESTSIZE;};
15     typedef T_HashWordType HashWordType;
16     CRYPTOPP_CONSTANT(BLOCKSIZE = T_BlockSize)
17
18 protected:
19         IteratedHashWithStaticTransform() {this->Init();}
20         void HashEndianCorrectedBlock(const T_HashWordType *data) {T_Transform::Transform(this->m_state, data);}
21         void Init() {T_Transform::InitState(this->m_state);}
22
23         T_HashWordType* StateBuf() {return this->m_state;}
24         FixedSizeAlignedSecBlock<T_HashWordType, T_BlockSize/sizeof(T_HashWordType), T_StateAligned> m_state;
25 };
26
27 NAMESPACE_END
28
29 #endif