Kea 2.0.3
cryptolink.cc
Go to the documentation of this file.
1// Copyright (C) 2011-2018 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 <config.h>
8
12
13namespace isc {
14namespace cryptolink {
15
16CryptoLink&
18 CryptoLink& c = getCryptoLinkInternal();
19 if (c.impl_ == NULL) {
20 c.initialize();
21 }
22 return (c);
23}
24
26CryptoLink::getCryptoLinkInternal() {
27 static CryptoLink instance;
28 return (instance);
29}
30
31Hash*
33{
34 return (new Hash(hash_algorithm));
35}
36
37HMAC*
38CryptoLink::createHMAC(const void* secret, size_t secret_len,
39 const HashAlgorithm hash_algorithm)
40{
41 return (new HMAC(secret, secret_len, hash_algorithm));
42}
43
44RNGPtr&
46 return (rng_);
47}
48
49} // namespace cryptolink
50} // namespace isc
51
Defines the logger used by the top-level component of kea-lfc.