Remove remains of experimental scrypt derivation support
authorMASM fan <masmfan@gmail.com>
Sun, 28 Dec 2014 00:33:22 +0000 (16:33 -0800)
committerMASM fan <masmfan@gmail.com>
Sun, 28 Dec 2014 00:33:22 +0000 (16:33 -0800)
src/crypter.cpp
src/scrypt.cpp
src/scrypt.h

index e808d06..d6c3bc3 100644 (file)
@@ -8,7 +8,6 @@
 #include <string>
 
 #include "crypter.h"
-#include "scrypt.h"
 
 #ifdef WIN32
 #include <windows.h>
@@ -26,17 +25,6 @@ bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::v
                           (unsigned char *)&strKeyData[0], strKeyData.size(), nRounds, chKey, chIV);
     }
 
-    if (nDerivationMethod == 1)
-    {
-        // Passphrase conversion
-        uint256 scryptHash = scrypt_salted_multiround_hash((const void*)strKeyData.c_str(), strKeyData.size(), &chSalt[0], 8, nRounds);
-
-        i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha512(), &chSalt[0],
-                          (unsigned char *)&scryptHash, sizeof scryptHash, nRounds, chKey, chIV);
-        OPENSSL_cleanse(&scryptHash, sizeof scryptHash);
-    }
-
-
     if (i != (int)WALLET_CRYPTO_KEY_SIZE)
     {
         OPENSSL_cleanse(&chKey, sizeof chKey);
index 3356d22..c0e237d 100644 (file)
@@ -29,49 +29,8 @@ uint256 scrypt_nosalt(const void* input, size_t inputlen, void *scratchpad)
     return result;
 }
 
-uint256 scrypt(const void* data, size_t datalen, const void* salt, size_t saltlen, void *scratchpad)
-{
-    unsigned int *V;
-    unsigned int X[32];
-    uint256 result = 0;
-    V = (unsigned int *)(((uintptr_t)(scratchpad) + 63) & ~ (uintptr_t)(63));
-
-    PBKDF2_SHA256((const uint8_t*)data, datalen, (const uint8_t*)salt, saltlen, 1, (uint8_t *)X, 128);
-    scrypt_core(X, V);
-    PBKDF2_SHA256((const uint8_t*)data, datalen, (uint8_t *)X, 128, 1, (uint8_t*)&result, 32);
-
-    return result;
-}
-
-uint256 scrypt_hash(const void* input, size_t inputlen)
-{
-    unsigned char scratchpad[SCRYPT_BUFFER_SIZE];
-    return scrypt_nosalt(input, inputlen, scratchpad);
-}
-
-uint256 scrypt_salted_hash(const void* input, size_t inputlen, const void* salt, size_t saltlen)
-{
-    unsigned char scratchpad[SCRYPT_BUFFER_SIZE];
-    return scrypt(input, inputlen, salt, saltlen, scratchpad);
-}
-
-uint256 scrypt_salted_multiround_hash(const void* input, size_t inputlen, const void* salt, size_t saltlen, const unsigned int nRounds)
-{
-    uint256 resultHash = scrypt_salted_hash(input, inputlen, salt, saltlen);
-    uint256 transitionalHash = resultHash;
-
-    for(unsigned int i = 1; i < nRounds; i++)
-    {
-        resultHash = scrypt_salted_hash(input, inputlen, (const void*)&transitionalHash, 32);
-        transitionalHash = resultHash;
-    }
-
-    return resultHash;
-}
-
 uint256 scrypt_blockhash(const void* input)
 {
     unsigned char scratchpad[SCRYPT_BUFFER_SIZE];
     return scrypt_nosalt(input, 80, scratchpad);
 }
-
index 17afd85..b28d090 100644 (file)
@@ -7,9 +7,6 @@
 #include "util.h"
 #include "net.h"
 
-uint256 scrypt_salted_multiround_hash(const void* input, size_t inputlen, const void* salt, size_t saltlen, const unsigned int nRounds);
-uint256 scrypt_salted_hash(const void* input, size_t inputlen, const void* salt, size_t saltlen);
-uint256 scrypt_hash(const void* input, size_t inputlen);
 uint256 scrypt_blockhash(const void* input);
 
 #endif // SCRYPT_MINE_H