Botan  1.11.15
src/lib/hash/md4/md4.h
Go to the documentation of this file.
00001 /*
00002 * MD4
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_MD4_H__
00009 #define BOTAN_MD4_H__
00010 
00011 #include <botan/mdx_hash.h>
00012 
00013 namespace Botan {
00014 
00015 /**
00016 * MD4
00017 */
00018 class BOTAN_DLL MD4 : public MDx_HashFunction
00019    {
00020    public:
00021       std::string name() const { return "MD4"; }
00022       size_t output_length() const { return 16; }
00023       HashFunction* clone() const { return new MD4; }
00024 
00025       void clear();
00026 
00027       MD4() : MDx_HashFunction(64, false, true), M(16), digest(4)
00028          { clear(); }
00029    protected:
00030       void compress_n(const byte input[], size_t blocks);
00031       void copy_out(byte[]);
00032 
00033       /**
00034       * The message buffer, exposed for use by subclasses (x86 asm)
00035       */
00036       secure_vector<u32bit> M;
00037 
00038       /**
00039       * The digest value, exposed for use by subclasses (x86 asm)
00040       */
00041       secure_vector<u32bit> digest;
00042    };
00043 
00044 }
00045 
00046 #endif