Botan  1.11.15
src/lib/hash/rmd160/rmd160.h
Go to the documentation of this file.
00001 /*
00002 * RIPEMD-160
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_RIPEMD_160_H__
00009 #define BOTAN_RIPEMD_160_H__
00010 
00011 #include <botan/mdx_hash.h>
00012 
00013 namespace Botan {
00014 
00015 /**
00016 * RIPEMD-160
00017 */
00018 class BOTAN_DLL RIPEMD_160 : public MDx_HashFunction
00019    {
00020    public:
00021       std::string name() const { return "RIPEMD-160"; }
00022       size_t output_length() const { return 20; }
00023       HashFunction* clone() const { return new RIPEMD_160; }
00024 
00025       void clear();
00026 
00027       RIPEMD_160() : MDx_HashFunction(64, false, true), M(16), digest(5)
00028          { clear(); }
00029    private:
00030       void compress_n(const byte[], size_t blocks);
00031       void copy_out(byte[]);
00032 
00033       secure_vector<u32bit> M, digest;
00034    };
00035 
00036 }
00037 
00038 #endif