From 7dfa5e9e6e05fb2b8bb346d92f2a22229ef495c8 Mon Sep 17 00:00:00 2001 From: stoffu Date: Mon, 5 Mar 2018 18:24:11 +0900 Subject: chacha: call prehashed version explicitly as generate_chacha_key_prehashed hash: add prehashed version cn_slow_hash_prehashed slow-hash: let cn_slow_hash take 4th parameter for deciding prehashed or not slow-hash: add support for prehashed version for the other 3 platforms --- src/crypto/hash.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/crypto/hash.h') diff --git a/src/crypto/hash.h b/src/crypto/hash.h index bf4f4c096..995e2294e 100644 --- a/src/crypto/hash.h +++ b/src/crypto/hash.h @@ -72,7 +72,11 @@ namespace crypto { } inline void cn_slow_hash(const void *data, std::size_t length, hash &hash, int variant = 0) { - cn_slow_hash(data, length, reinterpret_cast(&hash), variant); + cn_slow_hash(data, length, reinterpret_cast(&hash), variant, 0/*prehashed*/); + } + + inline void cn_slow_hash_prehashed(const void *data, std::size_t length, hash &hash, int variant = 0) { + cn_slow_hash(data, length, reinterpret_cast(&hash), variant, 1/*prehashed*/); } inline void tree_hash(const hash *hashes, std::size_t count, hash &root_hash) { -- cgit v1.2.3