Botan  1.11.15
src/lib/hash/gost_3411/gost_3411.h
Go to the documentation of this file.
00001 /*
00002 * GOST 34.11
00003 * (C) 2009 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_GOST_3411_H__
00009 #define BOTAN_GOST_3411_H__
00010 
00011 #include <botan/hash.h>
00012 #include <botan/gost_28147.h>
00013 
00014 namespace Botan {
00015 
00016 /**
00017 * GOST 34.11
00018 */
00019 class BOTAN_DLL GOST_34_11 : public HashFunction
00020    {
00021    public:
00022       std::string name() const { return "GOST-R-34.11-94" ; }
00023       size_t output_length() const { return 32; }
00024       size_t hash_block_size() const { return 32; }
00025       HashFunction* clone() const { return new GOST_34_11; }
00026 
00027       void clear();
00028 
00029       GOST_34_11();
00030    private:
00031       void compress_n(const byte input[], size_t blocks);
00032 
00033       void add_data(const byte[], size_t);
00034       void final_result(byte[]);
00035 
00036       GOST_28147_89 cipher;
00037       secure_vector<byte> buffer, sum, hash;
00038       size_t position;
00039       u64bit count;
00040    };
00041 
00042 }
00043 
00044 #endif