Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 BOTAN_FUTURE_INTERNAL_HEADER(keccak.h)
18
19 /**
20 * Keccak[1600], a SHA-3 candidate
21 */
22 class BOTAN_PUBLIC_API(2,0) Keccak_1600 final : public HashFunction
23 {
24 public:
25
26 /**
27 * @param output_bits the size of the hash output; must be one of
28 * 224, 256, 384, or 512
29 */
30 explicit Keccak_1600(size_t output_bits = 512);
31
32 size_t hash_block_size() const override { return m_bitrate / 8; }
33 size_t output_length() const override { return m_output_bits / 8; }
34
35 HashFunction* clone() const override;
36 std::unique_ptr<HashFunction> copy_state() const override;
37 std::string name() const override;
38 void clear() override;
39
40 private:
41 void add_data(const uint8_t input[], size_t length) override;
42 void final_result(uint8_t out[]) override;
43
44 size_t m_output_bits, m_bitrate;
45 secure_vector<uint64_t> m_S;
46 size_t m_S_pos;
47 };
48
49 }
50
51 #endif
Botan::Keccak_1600::hash_block_size
size_t hash_block_size() const override
Definition: keccak.h:32
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
name
std::string name
Definition: commoncrypto_hash.cpp:23
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:65
Botan::Keccak_1600::output_length
size_t output_length() const override
Definition: keccak.h:33
Botan
Definition: alg_id.cpp:13
Botan::HashFunction
Definition: hash.h:20
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139
Botan::Keccak_1600
Definition: keccak.h:22