Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

tls_handshake_hash.h
Go to the documentation of this file.
1 /*
2 * TLS Handshake Hash
3 * (C) 2004-2006,2011,2012 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_TLS_HANDSHAKE_HASH_H__
9 #define BOTAN_TLS_HANDSHAKE_HASH_H__
10
11 #include <botan/secmem.h>
12 #include <botan/tls_version.h>
13 #include <botan/tls_magic.h>
14
15 namespace Botan {
16
17 namespace TLS {
18
19 /**
20 * TLS Handshake Hash
21 */
22 class Handshake_Hash
23 {
24 public:
25 void update(const uint8_t in[], size_t length)
26 { m_data += std::make_pair(in, length); }
27
28 void update(const std::vector<uint8_t>& in)
29 { m_data += in; }
30
31 secure_vector<uint8_t> final(Protocol_Version version,
32 const std::string& mac_algo) const;
33
34 const std::vector<uint8_t>& get_contents() const { return m_data; }
35
36 void reset() { m_data.clear(); }
37 private:
38 std::vector<uint8_t> m_data;
39 };
40
41 }
42
43 }
44
45 #endif
Botan::TLS::Handshake_Hash::get_contents
const std::vector< uint8_t > & get_contents() const
Definition: tls_handshake_hash.h:34
Botan::TLS::Handshake_Hash::reset
void reset()
Definition: tls_handshake_hash.h:36
Botan::TLS::Handshake_Hash
Definition: tls_handshake_hash.h:22
Botan::TLS::Protocol_Version
Definition: tls_version.h:21
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::TLS::Handshake_Hash::update
void update(const uint8_t in[], size_t length)
Definition: tls_handshake_hash.h:25
Botan
Definition: alg_id.cpp:13
Botan::TLS::Handshake_Hash::update
void update(const std::vector< uint8_t > &in)
Definition: tls_handshake_hash.h:28