Kea  1.9.9-git
crypto_hash.h
Go to the documentation of this file.
1 // Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #include <util/buffer.h>
8 
9 #include <boost/noncopyable.hpp>
10 
11 #include <cryptolink/cryptolink.h>
12 
13 #ifndef ISC_CRYPTO_HASH_H
14 #define ISC_CRYPTO_HASH_H
15 
16 namespace isc {
17 namespace cryptolink {
18 
20 class HashImpl;
21 
27 class Hash : private boost::noncopyable {
28 private:
37  Hash(const HashAlgorithm hash_algorithm);
38 
40 
41 public:
43  ~Hash();
44 
49 
53  size_t getOutputLength() const;
54 
62  void update(const void* data, const size_t len);
63 
76  void final(isc::util::OutputBuffer& result, size_t len);
77 
92  void final(void* result, size_t len);
93 
106  std::vector<uint8_t> final(size_t len);
107 
108 private:
109  HashImpl* impl_;
110 };
111 
131 void digest(const void* data,
132  const size_t data_len,
133  const HashAlgorithm hash_algorithm,
134  isc::util::OutputBuffer& result,
135  size_t len = 0);
136 
138 void deleteHash(Hash* hash);
139 
140 } // namespace cryptolink
141 } // namespace isc
142 
143 #endif // ISC_CRYPTO_HASH_H
144 
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition: buffer.h:294
Defines the logger used by the top-level component of kea-dhcp-ddns.