mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-23 13:47:47 +00:00
chacha: fix build with GCC 8.1
This commit is contained in:
parent
52f6b33890
commit
4a72d595a6
1 changed files with 2 additions and 2 deletions
|
@ -73,14 +73,14 @@ namespace crypto {
|
||||||
static_assert(sizeof(chacha_key) <= sizeof(hash), "Size of hash must be at least that of chacha_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;
|
tools::scrubbed_arr<char, HASH_SIZE> pwd_hash;
|
||||||
crypto::cn_slow_hash(data, size, pwd_hash.data(), 0/*variant*/, 0/*prehashed*/);
|
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) {
|
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");
|
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;
|
tools::scrubbed_arr<char, HASH_SIZE> pwd_hash;
|
||||||
crypto::cn_slow_hash(data, size, pwd_hash.data(), 0/*variant*/, 1/*prehashed*/);
|
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) {
|
inline void generate_chacha_key(std::string password, chacha_key& key) {
|
||||||
|
|
Loading…
Reference in a new issue