From 6f0f5b5e836f4ca8e418cb2f6d871140c0adf4bf Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Mon, 3 Nov 2025 17:12:27 +0000 Subject: [PATCH] fixed view-only wallet support --- src/cryptonote_basic/account.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/cryptonote_basic/account.cpp b/src/cryptonote_basic/account.cpp index 3b4b72281..c7ad82eec 100644 --- a/src/cryptonote_basic/account.cpp +++ b/src/cryptonote_basic/account.cpp @@ -89,24 +89,12 @@ DISABLE_VS_WARNINGS(4244 4345) void account_keys::xor_with_key_stream(const crypto::chacha_key &key) { // encrypt a large enough byte stream with chacha20 - epee::wipeable_string key_stream = get_key_stream(key, m_encryption_iv, sizeof(crypto::secret_key) * (8 + m_multisig_keys.size())); + epee::wipeable_string key_stream = get_key_stream(key, m_encryption_iv, sizeof(crypto::secret_key) * (2 + m_multisig_keys.size())); const char *ptr = key_stream.data(); for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) m_spend_secret_key.data[i] ^= *ptr++; for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) m_view_secret_key.data[i] ^= *ptr++; - for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) - s_master.data[i] ^= *ptr++; - for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) - k_prove_spend.data[i] ^= *ptr++; - for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) - s_view_balance.data[i] ^= *ptr++; - for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) - k_view_incoming.data[i] ^= *ptr++; - for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) - k_generate_image.data[i] ^= *ptr++; - for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) - s_generate_address.data[i] ^= *ptr++; for (crypto::secret_key &k: m_multisig_keys) { for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) @@ -128,15 +116,11 @@ DISABLE_VS_WARNINGS(4244 4345) void account_keys::encrypt_viewkey(const crypto::chacha_key &key) { // encrypt a large enough byte stream with chacha20 - epee::wipeable_string key_stream = get_key_stream(key, m_encryption_iv, sizeof(crypto::secret_key) * 3); + epee::wipeable_string key_stream = get_key_stream(key, m_encryption_iv, sizeof(crypto::secret_key) * 2); const char *ptr = key_stream.data(); ptr += sizeof(crypto::secret_key); for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) m_view_secret_key.data[i] ^= *ptr++; - for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) - s_view_balance.data[i] ^= *ptr++; - for (size_t i = 0; i < sizeof(crypto::secret_key); ++i) - k_view_incoming.data[i] ^= *ptr++; } //----------------------------------------------------------------- void account_keys::decrypt_viewkey(const crypto::chacha_key &key)