aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-08-22 14:21:32 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-08-22 21:04:50 +0100
commitf19759992cbd70db8736e1485138f0af647cc047 (patch)
tree6d583c4035f2786a79f8c7e7d3e714bb4a92c88e /src/wallet/wallet2.h
parentchacha8: add a key generation variant that take a pointer and size (diff)
downloadmonero-f19759992cbd70db8736e1485138f0af647cc047.tar.xz
wallet: encrypt the cache file
It contains private data, such as a record of transactions. The key is derived from the view and spend secret keys. The encryption currently is one shot, so may require a lot of memory for large wallet caches.
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index ffe9ad0e5..cb816f83b 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -133,6 +133,17 @@ namespace tools
END_SERIALIZE()
};
+ struct cache_file_data
+ {
+ crypto::chacha8_iv iv;
+ std::string cache_data;
+
+ BEGIN_SERIALIZE_OBJECT()
+ FIELD(iv)
+ FIELD(cache_data)
+ END_SERIALIZE()
+ };
+
/*!
* \brief Generates a wallet or restores one.
* \param wallet_ Name of wallet file
@@ -307,6 +318,7 @@ namespace tools
void add_unconfirmed_tx(const cryptonote::transaction& tx, uint64_t change_amount);
void generate_genesis(cryptonote::block& b);
void check_genesis(const crypto::hash& genesis_hash) const; //throws
+ bool generate_chacha8_key_from_secret_keys(crypto::chacha8_key &key) const;
cryptonote::account_base m_account;
std::string m_daemon_address;