Kea  1.9.9-git
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 
10 #include <cryptolink/crypto_hash.h>
11 #include <cryptolink/crypto_hmac.h>
12 
13 namespace isc {
14 namespace cryptolink {
15 
16 CryptoLink&
18  CryptoLink& c = getCryptoLinkInternal();
19  if (c.impl_ == NULL) {
20  c.initialize();
21  }
22  return (c);
23 }
24 
26 CryptoLink::getCryptoLinkInternal() {
27  static CryptoLink instance;
28  return (instance);
29 }
30 
31 Hash*
33 {
34  return (new Hash(hash_algorithm));
35 }
36 
37 HMAC*
38 CryptoLink::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 
44 RNGPtr&
46  return (rng_);
47 }
48 
49 } // namespace cryptolink
50 } // namespace isc
51 
Defines the logger used by the top-level component of kea-dhcp-ddns.