Kea: crypto_hash.h Source File

| Kea 3.0.3-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
16namespace isc {
17namespace cryptolink {
18
20class HashImpl;
21
27 class Hash : private boost::noncopyable {
28private:
37 Hash(const HashAlgorithm hash_algorithm);
38
39 friend Hash* CryptoLink::createHash(const HashAlgorithm);
40
41public:
43 ~Hash();
44
48 HashAlgorithm getHashAlgorithm() const;
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
108private:
109 HashImpl* impl_;
110};
111
131void 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
138void deleteHash(Hash* hash);
139
140} // namespace cryptolink
141} // namespace isc
142
143#endif // ISC_CRYPTO_HASH_H
144
buffer.h
isc::cryptolink::CryptoLink::createHash
Hash * createHash(const HashAlgorithm hash_algorithm)
Factory function for Hash objects.
Definition cryptolink.cc:23
isc::cryptolink::HashImpl
Botan implementation of Hash.
Definition botan_hash.cc:45
isc::cryptolink::Hash
Hash support.
Definition crypto_hash.h:27
isc::cryptolink::Hash::update
void update(const void *data, const size_t len)
Add data to digest.
Definition botan_hash.cc:175
isc::cryptolink::Hash::~Hash
~Hash()
Destructor.
Definition botan_hash.cc:160
isc::cryptolink::Hash::getOutputLength
size_t getOutputLength() const
Returns the output size of the digest.
Definition botan_hash.cc:170
isc::cryptolink::Hash::getHashAlgorithm
HashAlgorithm getHashAlgorithm() const
Returns the HashAlgorithm of the object.
Definition botan_hash.cc:165
isc::util::OutputBuffer
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition buffer.h:346
cryptolink.h
isc::cryptolink
Definition botan_common.h:8
isc::cryptolink::HashAlgorithm
HashAlgorithm
Hash algorithm identifiers.
Definition cryptolink.h:23
isc::cryptolink::deleteHash
void deleteHash(Hash *hash)
Delete an Hash object.
Definition crypto_hash.cc:34
isc::cryptolink::digest
void digest(const void *data, const size_t data_len, const HashAlgorithm hash_algorithm, isc::util::OutputBuffer &result, size_t len)
Create an Hash digest for the given data.
Definition crypto_hash.cc:20
isc::data
Definition base_stamped_element.cc:12
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148