From 881c78620a35fbc93d3491c381f82f957a9f83f1 Mon Sep 17 00:00:00 2001 From: MASM fan Date: Fri, 23 Jan 2015 17:57:27 -0800 Subject: [PATCH] Remove remainings of of sha512+scrypt key derivation --- src/crypter.h | 20 -------------------- src/init.cpp | 3 --- src/main.h | 1 - src/wallet.cpp | 2 +- 4 files changed, 1 insertions(+), 25 deletions(-) diff --git a/src/crypter.h b/src/crypter.h index 68b8803..bddcdfd 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -56,26 +56,6 @@ public: nDerivationMethod = 1; vchOtherDerivationParameters = std::vector(0); } - - CMasterKey(unsigned int nDerivationMethodIndex) - { - switch (nDerivationMethodIndex) - { - case 0: // sha512 - default: - nDeriveIterations = 25000; - nDerivationMethod = 0; - vchOtherDerivationParameters = std::vector(0); - break; - - case 1: // scrypt+sha512 - nDeriveIterations = 10000; - nDerivationMethod = 1; - vchOtherDerivationParameters = std::vector(0); - break; - } - } - }; typedef std::vector > CKeyingMaterial; diff --git a/src/init.cpp b/src/init.cpp index 3e55c3c..34cb698 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -31,7 +31,6 @@ CClientUIInterface uiInterface; std::string strWalletFileName; bool fConfChange; unsigned int nNodeLifespan; -unsigned int nDerivationMethodIndex; unsigned int nMinerSleep; bool fUseFastIndex; bool fUseFastStakeMiner; @@ -398,8 +397,6 @@ bool AppInit2() CheckpointsMode = Checkpoints::PERMISSIVE; } - nDerivationMethodIndex = 0; - fTestNet = GetBoolArg("-testnet"); if (fTestNet) { SoftSetBoolArg("-irc", true); diff --git a/src/main.h b/src/main.h index 692c6b0..8ee3d31 100644 --- a/src/main.h +++ b/src/main.h @@ -93,7 +93,6 @@ extern std::map mapOrphanBlocks; extern int64_t nTransactionFee; extern int64_t nMinimumInputValue; extern bool fUseFastIndex; -extern unsigned int nDerivationMethodIndex; extern int nScriptCheckThreads; extern const uint256 entropyStore[38]; diff --git a/src/wallet.cpp b/src/wallet.cpp index dc609b8..67a1859 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -306,7 +306,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE); RAND_bytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE); - CMasterKey kMasterKey(nDerivationMethodIndex); + CMasterKey kMasterKey; RandAddSeedPerfmon(); kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE); -- 1.7.1