Botan 3.13.0
Crypto and TLS for C&
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
13namespace Botan {
14
16 public:
17 SipHash(size_t c, size_t d);
18
19 void clear() override;
20 std::string name() const override;
21
22 std::unique_ptr<MessageAuthenticationCode> new_object() const override;
23
24 size_t output_length() const override { return 8; }
25
26 bool has_keying_material() const override;
27
29
30 private:
31 void add_data(std::span<const uint8_t> input) override;
32 void final_result(std::span<uint8_t> output) override;
33 void start_msg(std::span<const uint8_t> nonce) override;
34 void key_schedule(std::span<const uint8_t> key) override;
35 void reset_msg();
36
37 const size_t m_C, m_D;
40 uint64_t m_mbuf = 0;
41 size_t m_mbuf_pos = 0;
42 uint8_t m_words = 0;
43};
44
45} // namespace Botan
46
47#endif
void final(uint8_t out[])
Definition buf_comp.h:97
void clear() override
Definition siphash.cpp:147
std::string name() const override
Definition siphash.cpp:155
Key_Length_Specification key_spec() const override
Definition siphash.h:28
SipHash(size_t c, size_t d)
Definition siphash.cpp:54
bool has_keying_material() const override
Definition siphash.cpp:131
size_t output_length() const override
Definition siphash.h:24
std::unique_ptr< MessageAuthenticationCode > new_object() const override
Definition siphash.cpp:159
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:128