Merge pull request #186

3300ae5 remove unused display variable (warptangent)
0e0e557 return true on success (warptangent)
2e11eb1 deterministic wallet use of twelve words fixed (warptangent)
21a3c46 ensure that keccak is called on view spend key, not a possibly pre-sc_reduce32 version of it - for deriving view secret key (warptangent)
This commit is contained in:
Riccardo Spagni 2014-12-02 07:34:27 +02:00
commit ef2a2b42c9
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
3 changed files with 3 additions and 6 deletions

View File

@ -65,7 +65,7 @@ DISABLE_VS_WARNINGS(4244 4345)
// rng for generating second set of keys is hash of first rng. means only one set of electrum-style words needed for recovery // rng for generating second set of keys is hash of first rng. means only one set of electrum-style words needed for recovery
crypto::secret_key second; crypto::secret_key second;
keccak((uint8_t *)&first, sizeof(crypto::secret_key), (uint8_t *)&second, sizeof(crypto::secret_key)); keccak((uint8_t *)&m_keys.m_spend_secret_key, sizeof(crypto::secret_key), (uint8_t *)&second, sizeof(crypto::secret_key));
generate_keys(m_keys.m_account_address.m_view_public_key, m_keys.m_view_secret_key, second, two_random ? false : true); generate_keys(m_keys.m_account_address.m_view_public_key, m_keys.m_view_secret_key, second, two_random ? false : true);

View File

@ -255,7 +255,7 @@ namespace crypto
std::string wlist_copy = words; std::string wlist_copy = words;
if (seed.size() == seed_length/2) if (seed.size() == seed_length/2)
{ {
memcpy(dst.data, dst.data + 16, 16); // if electrum 12-word seed, duplicate memcpy(dst.data+16, dst.data, 16); // if electrum 12-word seed, duplicate
wlist_copy += ' '; wlist_copy += ' ';
wlist_copy += words; wlist_copy += words;
} }
@ -328,7 +328,7 @@ namespace crypto
words.pop_back(); words.pop_back();
words += (' ' + words_store[create_checksum_index(words_store, language->get_unique_prefix_length())]); words += (' ' + words_store[create_checksum_index(words_store, language->get_unique_prefix_length())]);
return false; return true;
} }
/*! /*!

View File

@ -551,9 +551,6 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
crypto::ElectrumWords::bytes_to_words(recovery_val, electrum_words, mnemonic_language); crypto::ElectrumWords::bytes_to_words(recovery_val, electrum_words, mnemonic_language);
std::string print_electrum = "";
success_msg_writer() << success_msg_writer() <<
"**********************************************************************\n" << "**********************************************************************\n" <<
"Your wallet has been generated.\n" << "Your wallet has been generated.\n" <<