Coverage Report

Created: 2022-06-23 06:44

/src/botan/build/include/botan/internal/tls_handshake_hash.h
Line
Count
Source (jump to first uncovered line)
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
14
namespace Botan {
15
16
namespace TLS {
17
18
/**
19
* TLS Handshake Hash
20
*/
21
class Handshake_Hash final
22
   {
23
   public:
24
      void update(const uint8_t in[], size_t length)
25
0
         { m_data += std::make_pair(in, length); }
26
27
      void update(const std::vector<uint8_t>& in)
28
98.1k
         { m_data += in; }
29
30
      secure_vector<uint8_t> final(const std::string& mac_algo) const;
31
32
0
      const std::vector<uint8_t>& get_contents() const { return m_data; }
33
34
1.17k
      void reset() { m_data.clear(); }
35
   private:
36
      std::vector<uint8_t> m_data;
37
   };
38
39
}
40
41
}
42
43
#endif