Botan 3.6.1
Crypto and TLS for C&
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
14namespace Botan::TLS {
15
16/**
17* TLS Handshake Hash
18*/
20 public:
21 void update(const uint8_t in[], size_t length) { m_data += std::make_pair(in, length); }
22
23 void update(const std::vector<uint8_t>& in) { m_data += in; }
24
25 secure_vector<uint8_t> final(std::string_view mac_algo) const;
26
27 const std::vector<uint8_t>& get_contents() const { return m_data; }
28
29 void reset() { m_data.clear(); }
30
31 private:
32 std::vector<uint8_t> m_data;
33};
34
35} // namespace Botan::TLS
36
37#endif
const std::vector< uint8_t > & get_contents() const
void update(const uint8_t in[], size_t length)
void update(const std::vector< uint8_t > &in)
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61