Skip to content

Commit

Permalink
crypto: add sha256 dispatcher to init, bench and test_bitcoin
Browse files Browse the repository at this point in the history
  • Loading branch information
xanimo committed Apr 24, 2024
1 parent 06eee49 commit 26d1af1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bench/bench_bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

#include "bench.h" // for BenchRunner
#include "key.h" // for ECC_Start, ECC_Stop
#include "crypto/sha256.h"
#include "util.h" // for SetupEnvironment, fPrintToDebugLog
#include "validation.h"
#include "random.h"

int
main(int argc, char** argv)
{
detect_sha256_hardware();
RandomInit();
ECC_Start();
SetupEnvironment();
Expand Down
1 change: 1 addition & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,7 @@ bool AppInitSanityChecks()
// ********************************************************* Step 4: sanity checks

// Initialize elliptic curve code
detect_sha256_hardware();
RandomInit();
ECC_Start();
globalVerifyHandle.reset(new ECCVerifyHandle());
Expand Down
2 changes: 2 additions & 0 deletions src/test/test_bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "chainparams.h"
#include "consensus/consensus.h"
#include "consensus/validation.h"
#include "crypto/sha256.h"
#include "fs.h"
#include "key.h"
#include "validation.h"
Expand Down Expand Up @@ -43,6 +44,7 @@ static const int COINBASE_MATURITY = 60*4; // 4 hours of blocks

BasicTestingSetup::BasicTestingSetup(const std::string& chainName)
{
detect_sha256_hardware();
RandomInit();
ECC_Start();
SetupEnvironment();
Expand Down

0 comments on commit 26d1af1

Please sign in to comment.