Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/crypter.h
Show All 34 Lines | public: | ||||
//! 0 = EVP_sha512() | //! 0 = EVP_sha512() | ||||
//! 1 = scrypt() | //! 1 = scrypt() | ||||
unsigned int nDerivationMethod; | unsigned int nDerivationMethod; | ||||
unsigned int nDeriveIterations; | unsigned int nDeriveIterations; | ||||
//! Use this for more parameters to key derivation, such as the various | //! Use this for more parameters to key derivation, such as the various | ||||
//! parameters to scrypt | //! parameters to scrypt | ||||
std::vector<uint8_t> vchOtherDerivationParameters; | std::vector<uint8_t> vchOtherDerivationParameters; | ||||
ADD_SERIALIZE_METHODS; | SERIALIZE_METHODS(CMasterKey, obj) { | ||||
READWRITE(obj.vchCryptedKey, obj.vchSalt, obj.nDerivationMethod, | |||||
template <typename Stream, typename Operation> | obj.nDeriveIterations, obj.vchOtherDerivationParameters); | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | |||||
READWRITE(vchCryptedKey); | |||||
READWRITE(vchSalt); | |||||
READWRITE(nDerivationMethod); | |||||
READWRITE(nDeriveIterations); | |||||
READWRITE(vchOtherDerivationParameters); | |||||
} | } | ||||
CMasterKey() { | CMasterKey() { | ||||
// 25000 rounds is just under 0.1 seconds on a 1.86 GHz Pentium M | // 25000 rounds is just under 0.1 seconds on a 1.86 GHz Pentium M | ||||
// ie slightly lower than the lowest hardware we need bother supporting | // ie slightly lower than the lowest hardware we need bother supporting | ||||
nDeriveIterations = 25000; | nDeriveIterations = 25000; | ||||
nDerivationMethod = 0; | nDerivationMethod = 0; | ||||
vchOtherDerivationParameters = std::vector<uint8_t>(0); | vchOtherDerivationParameters = std::vector<uint8_t>(0); | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |