Botan  1.11.15
src/lib/hash/whirlpool/whrlpool.h
Go to the documentation of this file.
00001 /*
00002 * Whirlpool
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_WHIRLPOOL_H__
00009 #define BOTAN_WHIRLPOOL_H__
00010 
00011 #include <botan/mdx_hash.h>
00012 
00013 namespace Botan {
00014 
00015 /**
00016 * Whirlpool
00017 */
00018 class BOTAN_DLL Whirlpool : public MDx_HashFunction
00019    {
00020    public:
00021       std::string name() const { return "Whirlpool"; }
00022       size_t output_length() const { return 64; }
00023       HashFunction* clone() const { return new Whirlpool; }
00024 
00025       void clear();
00026 
00027       Whirlpool() : MDx_HashFunction(64, true, true, 32), M(8), digest(8)
00028          { clear(); }
00029    private:
00030       void compress_n(const byte[], size_t blocks);
00031       void copy_out(byte[]);
00032 
00033       static const u64bit C0[256];
00034       static const u64bit C1[256];
00035       static const u64bit C2[256];
00036       static const u64bit C3[256];
00037       static const u64bit C4[256];
00038       static const u64bit C5[256];
00039       static const u64bit C6[256];
00040       static const u64bit C7[256];
00041 
00042       secure_vector<u64bit> M, digest;
00043    };
00044 
00045 }
00046 
00047 #endif