diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-03-06 08:41:02 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-03-06 08:41:02 +0200 |
commit | c102c49da5015592d2a2fedf0ae348495ec382df (patch) | |
tree | ba6f9a6ccc7e9d112ac2e305eac0160da2bdcbdf /src/crypto/chacha.h | |
parent | Merge pull request #3261 (diff) | |
parent | tweaks to the monerov1 cryptonight algorithm (diff) | |
download | monero-c102c49da5015592d2a2fedf0ae348495ec382df.tar.xz |
Merge pull request #3253
e136bc6b tweaks to the monerov1 cryptonight algorithm (Lee Clagett)
d58c9ec9 slow-hash: optimized version (SChernykh)
608fd6f1 Monero Cryptonight variants, and add one for v7 (moneromooo-monero)
Diffstat (limited to 'src/crypto/chacha.h')
-rw-r--r-- | src/crypto/chacha.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/chacha.h b/src/crypto/chacha.h index b45c3d7c7..22da53bd0 100644 --- a/src/crypto/chacha.h +++ b/src/crypto/chacha.h @@ -69,10 +69,10 @@ namespace crypto { chacha20(data, length, key.data(), reinterpret_cast<const uint8_t*>(&iv), cipher); } - inline void generate_chacha_key(const void *data, size_t size, chacha_key& key, bool prehashed=false) { + inline void generate_chacha_key(const void *data, size_t size, chacha_key& key, int cn_variant = 0, bool prehashed=false) { 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_pre(data, size, pwd_hash.data(), prehashed); + crypto::cn_slow_hash_pre(data, size, pwd_hash.data(), cn_variant, prehashed); memcpy(&key, pwd_hash.data(), sizeof(key)); } |