2022-05-25 14:31:54 -04:00
|
|
|
// Copyright (c) 2022 The Bitcoin Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#include <kernel/context.h>
|
|
|
|
|
|
|
|
#include <crypto/sha256.h>
|
|
|
|
#include <logging.h>
|
|
|
|
#include <random.h>
|
|
|
|
|
2024-07-27 16:36:02 +02:00
|
|
|
#include <mutex>
|
2022-05-25 14:31:54 -04:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace kernel {
|
|
|
|
Context::Context()
|
|
|
|
{
|
2024-07-27 16:36:02 +02:00
|
|
|
static std::once_flag globals_initialized{};
|
|
|
|
std::call_once(globals_initialized, []() {
|
|
|
|
std::string sha256_algo = SHA256AutoDetect();
|
|
|
|
LogInfo("Using the '%s' SHA256 implementation\n", sha256_algo);
|
|
|
|
RandomInit();
|
|
|
|
});
|
2022-05-25 14:31:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace kernel
|