chacha: fix build with GCC 8.1

pull/36/head
moneromooo-monero 6 years ago committed by wowario
parent 7572b3578f
commit e303fd1e1d
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111

@ -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) {

Loading…
Cancel
Save