Botan  1.11.15
src/lib/hash/hash.h
Go to the documentation of this file.
00001 /*
00002 * Hash Function Base Class
00003 * (C) 1999-2008 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_HASH_FUNCTION_BASE_CLASS_H__
00009 #define BOTAN_HASH_FUNCTION_BASE_CLASS_H__
00010 
00011 #include <botan/scan_name.h>
00012 #include <botan/buf_comp.h>
00013 #include <string>
00014 
00015 namespace Botan {
00016 
00017 /**
00018 * This class represents hash function (message digest) objects
00019 */
00020 class BOTAN_DLL HashFunction : public Buffered_Computation
00021    {
00022    public:
00023       /**
00024       * @return new object representing the same algorithm as *this
00025       */
00026       virtual HashFunction* clone() const = 0;
00027 
00028       virtual void clear() = 0;
00029 
00030       virtual std::string name() const = 0;
00031 
00032       /**
00033       * @return hash block size as defined for this algorithm
00034       */
00035       virtual size_t hash_block_size() const { return 0; }
00036 
00037       typedef SCAN_Name Spec;
00038    };
00039 
00040 }
00041 
00042 #endif