LCOV - code coverage report
Current view: top level - src/kernel - context.cpp (source / functions) Hit Total Coverage
Test: fuzz_coverage.info Lines: 14 14 100.0 %
Date: 2023-09-26 12:08:55 Functions: 3 3 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2022 The Bitcoin Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #include <kernel/context.h>
       6             : 
       7             : #include <crypto/sha256.h>
       8             : #include <key.h>
       9             : #include <logging.h>
      10             : #include <pubkey.h>
      11             : #include <random.h>
      12             : 
      13             : #include <string>
      14             : 
      15             : 
      16             : namespace kernel {
      17             : Context* g_context;
      18             : 
      19          69 : Context::Context()
      20             : {
      21          69 :     assert(!g_context);
      22          69 :     g_context = this;
      23          69 :     std::string sha256_algo = SHA256AutoDetect();
      24          69 :     LogPrintf("Using the '%s' SHA256 implementation\n", sha256_algo);
      25          69 :     RandomInit();
      26          69 :     ECC_Start();
      27          69 : }
      28             : 
      29          69 : Context::~Context()
      30             : {
      31          69 :     ECC_Stop();
      32          69 :     assert(g_context);
      33          69 :     g_context = nullptr;
      34          69 : }
      35             : 
      36             : } // namespace kernel

Generated by: LCOV version 1.14