Botan  2.7.0
Crypto and TLS for C++11
keccak.h
Go to the documentation of this file.
1 /*
2 * Keccak
3 * (C) 2010 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_KECCAK_H_
9 #define BOTAN_KECCAK_H_
10 
11 #include <botan/hash.h>
12 #include <botan/secmem.h>
13 #include <string>
14 
15 namespace Botan {
16 
17 /**
18 * Keccak[1600], a SHA-3 candidate
19 */
20 class BOTAN_PUBLIC_API(2,0) Keccak_1600 final : public HashFunction
21  {
22  public:
23 
24  /**
25  * @param output_bits the size of the hash output; must be one of
26  * 224, 256, 384, or 512
27  */
28  explicit Keccak_1600(size_t output_bits = 512);
29 
30  size_t hash_block_size() const override { return m_bitrate / 8; }
31  size_t output_length() const override { return m_output_bits / 8; }
32 
33  HashFunction* clone() const override;
34  std::unique_ptr<HashFunction> copy_state() const override;
35  std::string name() const override;
36  void clear() override;
37 
38  private:
39  void add_data(const uint8_t input[], size_t length) override;
40  void final_result(uint8_t out[]) override;
41 
42  size_t m_output_bits, m_bitrate;
44  size_t m_S_pos;
45  };
46 
47 }
48 
49 #endif
size_t hash_block_size() const override
Definition: keccak.h:30
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
size_t output_length() const override
Definition: keccak.h:31
Definition: alg_id.cpp:13
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:88