diff options
author | lloyd <[email protected]> | 2008-11-08 19:17:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-08 19:17:33 +0000 |
commit | e021640afb43a70d2950a8cce3d71f0b7dade777 (patch) | |
tree | fbe42cda9c906fed3c0219065f31013da55ff937 /src/hash/hash.h | |
parent | 5d8a7d946ce81d94c95704c17934292355315520 (diff) |
Move hash.h from src/core to src/hash
Inline constructors for BlockCipher and StreamCipher
Diffstat (limited to 'src/hash/hash.h')
-rw-r--r-- | src/hash/hash.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/hash/hash.h b/src/hash/hash.h new file mode 100644 index 000000000..d42ee0d82 --- /dev/null +++ b/src/hash/hash.h @@ -0,0 +1,51 @@ +/** +* Hash Function Base Class +* (C) 1999-2008 Jack Lloyd +*/ + +#ifndef BOTAN_HASH_FUNCTION_BASE_CLASS_H__ +#define BOTAN_HASH_FUNCTION_BASE_CLASS_H__ + +#include <botan/types.h> +#include <botan/buf_comp.h> +#include <string> + +namespace Botan { + +/** +* This class represents hash function (message digest) objects. +*/ +class BOTAN_DLL HashFunction : public BufferedComputation + { + public: + /** + * The hash block size as defined for this algorithm. + */ + const u32bit HASH_BLOCK_SIZE; + + /** + * Get a new object representing the same algorithm as *this + */ + virtual HashFunction* clone() const = 0; + + /** + * Get the name of this algorithm. + * @return the name of this algorithm + */ + virtual std::string name() const = 0; + + /** + * Reset the internal state of this object. + */ + virtual void clear() throw() = 0; + + HashFunction(u32bit hash_len, u32bit block_len = 0) : + BufferedComputation(hash_len), HASH_BLOCK_SIZE(block_len) {} + virtual ~HashFunction() {} + private: + HashFunction& operator=(const HashFunction&); + }; + +} + +#endif |