diff options
author | luigi1111 <luigi1111w@gmail.com> | 2020-08-17 14:08:59 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2020-08-17 14:08:59 -0500 |
commit | 765db1ae7a3337d085584ab31983fe6b7599dbcb (patch) | |
tree | 8ee2064e832103be0890657f15973a15e3619edb /src/cryptonote_basic/account.h | |
parent | Merge pull request #6736 (diff) | |
download | monero-765db1ae7a3337d085584ab31983fe6b7599dbcb.tar.xz |
Revert "Use domain-separated ChaCha20 for in-memory key encryption"
This reverts commit 921dd8dde5d381052d0aa2936304a3541a230c55.
Diffstat (limited to '')
-rw-r--r-- | src/cryptonote_basic/account.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/cryptonote_basic/account.h b/src/cryptonote_basic/account.h index c71c06edd..5288b9b04 100644 --- a/src/cryptonote_basic/account.h +++ b/src/cryptonote_basic/account.h @@ -57,15 +57,16 @@ namespace cryptonote account_keys& operator=(account_keys const&) = default; - void encrypt_wrapper(const crypto::chacha_key &key, const bool all_keys); - void decrypt_wrapper(const crypto::chacha_key &key, const bool all_keys); - void decrypt_legacy(const crypto::chacha_key &key); + void encrypt(const crypto::chacha_key &key); + void decrypt(const crypto::chacha_key &key); + void encrypt_viewkey(const crypto::chacha_key &key); + void decrypt_viewkey(const crypto::chacha_key &key); hw::device& get_device() const ; void set_device( hw::device &hwdev) ; private: - void chacha_wrapper(const crypto::chacha_key &key, const bool all_keys); + void xor_with_key_stream(const crypto::chacha_key &key); }; /************************************************************************/ @@ -99,12 +100,10 @@ namespace cryptonote void forget_spend_key(); const std::vector<crypto::secret_key> &get_multisig_keys() const { return m_keys.m_multisig_keys; } - void encrypt_keys(const crypto::chacha_key &key) { m_keys.encrypt_wrapper(key, true); } - void encrypt_keys_same_iv(const crypto::chacha_key &key) { m_keys.decrypt_wrapper(key, true); } // encryption with the same IV is the same as decryption due to symmetry - void decrypt_keys(const crypto::chacha_key &key) { m_keys.decrypt_wrapper(key, true); } - void encrypt_viewkey(const crypto::chacha_key &key) { m_keys.encrypt_wrapper(key, false); } - void decrypt_viewkey(const crypto::chacha_key &key) { m_keys.decrypt_wrapper(key, false); } - void decrypt_legacy(const crypto::chacha_key &key) { m_keys.decrypt_legacy(key); } + void encrypt_keys(const crypto::chacha_key &key) { m_keys.encrypt(key); } + void decrypt_keys(const crypto::chacha_key &key) { m_keys.decrypt(key); } + void encrypt_viewkey(const crypto::chacha_key &key) { m_keys.encrypt_viewkey(key); } + void decrypt_viewkey(const crypto::chacha_key &key) { m_keys.decrypt_viewkey(key); } template <class t_archive> inline void serialize(t_archive &a, const unsigned int /*ver*/) |