diff options
Diffstat (limited to 'src/lib/hash/skein/skein_512.h')
-rw-r--r-- | src/lib/hash/skein/skein_512.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/lib/hash/skein/skein_512.h b/src/lib/hash/skein/skein_512.h index e0abc06ae..1fd514cf5 100644 --- a/src/lib/hash/skein/skein_512.h +++ b/src/lib/hash/skein/skein_512.h @@ -1,6 +1,6 @@ /* * The Skein-512 hash function -* (C) 2009 Jack Lloyd +* (C) 2009,2014 Jack Lloyd * * Distributed under the terms of the Botan license */ @@ -8,9 +8,10 @@ #ifndef BOTAN_SKEIN_512_H__ #define BOTAN_SKEIN_512_H__ -#include <botan/secmem.h> #include <botan/hash.h> +#include <botan/threefish.h> #include <string> +#include <memory> namespace Botan { @@ -35,13 +36,29 @@ class BOTAN_DLL Skein_512 : public HashFunction std::string name() const; void clear(); private: + enum type_code { + SKEIN_KEY = 0, + SKEIN_CONFIG = 4, + SKEIN_PERSONALIZATION = 8, + SKEIN_PUBLIC_KEY = 12, + SKEIN_KEY_IDENTIFIER = 16, + SKEIN_NONCE = 20, + SKEIN_MSG = 48, + SKEIN_OUTPUT = 63 + }; + void add_data(const byte input[], size_t length); void final_result(byte out[]); + void ubi_512(const byte msg[], size_t msg_len); + + void initial_block(); + void reset_tweak(type_code type, bool final); + std::string personalization; size_t output_bits; - secure_vector<u64bit> H; + std::unique_ptr<Threefish_512> m_threefish; secure_vector<u64bit> T; secure_vector<byte> buffer; size_t buf_pos; |