Botan 1.10.17
skein_512.h
Go to the documentation of this file.
1/*
2* The Skein-512 hash function
3* (C) 2009 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#ifndef BOTAN_SKEIN_512_H__
9#define BOTAN_SKEIN_512_H__
10
11#include <botan/secmem.h>
12#include <botan/hash.h>
13#include <string>
14
15namespace Botan {
16
17/**
18* Skein-512, a SHA-3 candidate
19*/
20class BOTAN_DLL Skein_512 : public HashFunction
21 {
22 public:
23 /**
24 * @param output_bits the output size of Skein in bits
25 * @param personalization is a string that will paramaterize the
26 * hash output
27 */
28 Skein_512(size_t output_bits = 512,
29 const std::string& personalization = "");
30
31 size_t hash_block_size() const { return 64; }
32 size_t output_length() const { return output_bits / 8; }
33
34 HashFunction* clone() const;
35 std::string name() const;
36 void clear();
37 private:
38 void add_data(const byte input[], size_t length);
39 void final_result(byte out[]);
40
41 std::string personalization;
42 size_t output_bits;
43
46 SecureVector<byte> buffer;
47 size_t buf_pos;
48 };
49
50}
51
52#endif
Skein_512(size_t output_bits=512, const std::string &personalization="")
size_t hash_block_size() const
Definition skein_512.h:31
size_t output_length() const
Definition skein_512.h:32