diff options
author | lloyd <[email protected]> | 2009-06-02 23:08:22 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-06-02 23:08:22 +0000 |
commit | ab6eace5760deeff742d515e7d72389cdd2d974b (patch) | |
tree | cd72edc4e3ea1463df2e79b376948c64ab07d61c /src/hash/skein/skein_512.h | |
parent | 820df981410c6d7490fc3728a2d52ca1c59dceda (diff) |
Add an implementation of Skein-512
Diffstat (limited to 'src/hash/skein/skein_512.h')
-rw-r--r-- | src/hash/skein/skein_512.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/hash/skein/skein_512.h b/src/hash/skein/skein_512.h new file mode 100644 index 000000000..a585ff47f --- /dev/null +++ b/src/hash/skein/skein_512.h @@ -0,0 +1,41 @@ +/** +* The Skein-512 hash function +* (C) 2009 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#ifndef BOTAN_SKEIN_H__ +#define BOTAN_SKEIN_H__ + +#include <botan/secmem.h> +#include <botan/hash.h> +#include <string> + +namespace Botan { + +class Skein_512 : public HashFunction + { + public: + Skein_512(u32bit output_bits = 512); + + HashFunction* clone() const { return new Skein_512(output_bits); } + + std::string name() const; + + void clear() throw(); + private: + void add_data(const byte input[], u32bit length); + void final_result(byte out[]); + + u32bit output_bits; + SecureBuffer<u64bit, 9> H; + SecureBuffer<u64bit, 3> T; + + SecureBuffer<byte, 64> buffer; + u32bit buf_pos; + }; + +} + +#endif |