Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

siphash.h
Go to the documentation of this file.
1 /*
2 * SipHash
3 * (C) 2014,2015 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_SIPHASH_H_
9 #define BOTAN_SIPHASH_H_
10
11 #include <botan/mac.h>
12
13 BOTAN_FUTURE_INTERNAL_HEADER(siphash.h)
14
15 namespace Botan {
16
17 class BOTAN_PUBLIC_API(2,0) SipHash final : public MessageAuthenticationCode
18 {
19 public:
20 SipHash(size_t c = 2, size_t d = 4) : m_C(c), m_D(d) {}
21
22 void clear() override;
23 std::string name() const override;
24
25 MessageAuthenticationCode* clone() const override;
26
27 size_t output_length() const override { return 8; }
28
29 Key_Length_Specification key_spec() const override
30 {
31 return Key_Length_Specification(16);
32 }
33 private:
34 void add_data(const uint8_t[], size_t) override;
35 void final_result(uint8_t[]) override;
36 void key_schedule(const uint8_t[], size_t) override;
37
38 const size_t m_C, m_D;
39 secure_vector<uint64_t> m_V;
40 uint64_t m_mbuf = 0;
41 size_t m_mbuf_pos = 0;
42 uint8_t m_words = 0;
43 };
44
45 }
46
47 #endif
Botan::Key_Length_Specification
Definition: key_spec.h:18
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::MessageAuthenticationCode
Definition: mac.h:21
Botan::SipHash::key_spec
Key_Length_Specification key_spec() const override
Definition: siphash.h:29
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:65
Botan::SymmetricAlgorithm::name
virtual std::string name() const =0
Botan::SipHash::SipHash
SipHash(size_t c=2, size_t d=4)
Definition: siphash.h:20
Botan::SymmetricAlgorithm::clear
virtual void clear()=0
Botan::SipHash::output_length
size_t output_length() const override
Definition: siphash.h:27
Botan
Definition: alg_id.cpp:13
Botan::MessageAuthenticationCode::clone
virtual MessageAuthenticationCode * clone() const =0
Botan::SipHash
Definition: siphash.h:17
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139