Botan  2.6.0
Crypto and TLS for C++11
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 namespace Botan {
14 
16  {
17  public:
18  SipHash(size_t c = 2, size_t d = 4) : m_C(c), m_D(d) {}
19 
20  void clear() override;
21  std::string name() const override;
22 
23  MessageAuthenticationCode* clone() const override;
24 
25  size_t output_length() const override { return 8; }
26 
28  {
29  return Key_Length_Specification(16);
30  }
31  private:
32  void add_data(const uint8_t[], size_t) override;
33  void final_result(uint8_t[]) override;
34  void key_schedule(const uint8_t[], size_t) override;
35 
36  const size_t m_C, m_D;
38  uint64_t m_mbuf = 0;
39  size_t m_mbuf_pos = 0;
40  uint8_t m_words = 0;
41  };
42 
43 }
44 
45 #endif
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
Key_Length_Specification key_spec() const override
Definition: siphash.h:27
SipHash(size_t c=2, size_t d=4)
Definition: siphash.h:18
size_t output_length() const override
Definition: siphash.h:25
Definition: alg_id.cpp:13
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:88