From 21a3c46a1b422514a375334da172074afe69b7fd Mon Sep 17 00:00:00 2001 From: warptangent Date: Fri, 7 Nov 2014 13:37:41 -0800 Subject: [PATCH 1/4] ensure that keccak is called on view spend key, not a possibly pre-sc_reduce32 version of it - for deriving view secret key --- src/cryptonote_core/account.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_core/account.cpp b/src/cryptonote_core/account.cpp index 36043238d..9f6c91026 100644 --- a/src/cryptonote_core/account.cpp +++ b/src/cryptonote_core/account.cpp @@ -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 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); From 2e11eb150444086dd936b10680bf354b548cc1f5 Mon Sep 17 00:00:00 2001 From: warptangent Date: Fri, 7 Nov 2014 14:02:39 -0800 Subject: [PATCH 2/4] deterministic wallet use of twelve words fixed --- src/mnemonics/electrum-words.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp index ffa82b21e..66ad9a59c 100644 --- a/src/mnemonics/electrum-words.cpp +++ b/src/mnemonics/electrum-words.cpp @@ -255,7 +255,7 @@ namespace crypto std::string wlist_copy = words; 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 += words; } From 0e0e55714d8bc8ff9c8637d7116825d9c64b28ae Mon Sep 17 00:00:00 2001 From: warptangent Date: Thu, 6 Nov 2014 14:36:36 -0800 Subject: [PATCH 3/4] return true on success --- src/mnemonics/electrum-words.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp index 66ad9a59c..7258b8a15 100644 --- a/src/mnemonics/electrum-words.cpp +++ b/src/mnemonics/electrum-words.cpp @@ -328,7 +328,7 @@ namespace crypto words.pop_back(); words += (' ' + words_store[create_checksum_index(words_store, language->get_unique_prefix_length())]); - return false; + return true; } /*! From 3300ae5f4e0f9b1b09515bc9b291150c0bc65146 Mon Sep 17 00:00:00 2001 From: warptangent Date: Thu, 6 Nov 2014 14:36:37 -0800 Subject: [PATCH 4/4] remove unused display variable --- src/simplewallet/simplewallet.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 84e134fed..073705653 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -544,9 +544,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); - std::string print_electrum = ""; - - success_msg_writer() << "**********************************************************************\n" << "Your wallet has been generated.\n" <<