aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/chacha.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-05-21 21:58:49 +0200
committerRiccardo Spagni <ric@spagni.net>2018-05-21 21:58:49 +0200
commita2cef8cba44eb0badf330dc057856a24c2a39739 (patch)
tree629ab24c5b8528e1b602b78d02aab4ac07e038c2 /src/crypto/chacha.h
parentMerge pull request #3842 (diff)
parentcrypto: more places needing fixing for GCC 8.1 (diff)
downloadmonero-a2cef8cba44eb0badf330dc057856a24c2a39739.tar.xz
Merge pull request #3800
9317bce9 crypto: more places needing fixing for GCC 8.1 (moneroexamples) 4a72d595 chacha: fix build with GCC 8.1 (moneromooo-monero)
Diffstat (limited to 'src/crypto/chacha.h')
-rw-r--r--src/crypto/chacha.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/chacha.h b/src/crypto/chacha.h
index 7a120931a..2b3ed8043 100644
--- a/src/crypto/chacha.h
+++ b/src/crypto/chacha.h
@@ -73,14 +73,14 @@ namespace crypto {
static_assert(sizeof(chacha_key) <= sizeof(hash), "Size of hash must be at least that of chacha_key");
tools::scrubbed_arr<char, HASH_SIZE> pwd_hash;
crypto::cn_slow_hash(data, size, pwd_hash.data(), 0/*variant*/, 0/*prehashed*/);
- memcpy(&key, pwd_hash.data(), sizeof(key));
+ memcpy(&unwrap(key), pwd_hash.data(), sizeof(key));
}
inline void generate_chacha_key_prehashed(const void *data, size_t size, chacha_key& key) {
static_assert(sizeof(chacha_key) <= sizeof(hash), "Size of hash must be at least that of chacha_key");
tools::scrubbed_arr<char, HASH_SIZE> pwd_hash;
crypto::cn_slow_hash(data, size, pwd_hash.data(), 0/*variant*/, 1/*prehashed*/);
- memcpy(&key, pwd_hash.data(), sizeof(key));
+ memcpy(&unwrap(key), pwd_hash.data(), sizeof(key));
}
inline void generate_chacha_key(std::string password, chacha_key& key) {