aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/hash.h
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2018-03-05 18:24:11 +0900
committerstoffu <stoffu@protonmail.ch>2018-03-14 21:00:17 +0900
commit7dfa5e9e6e05fb2b8bb346d92f2a22229ef495c8 (patch)
tree16d206dd1cc720babdfafa10e511e490badb1d6c /src/crypto/hash.h
parentcrypto: revert odd namespace changes made in #3303 (diff)
downloadmonero-7dfa5e9e6e05fb2b8bb346d92f2a22229ef495c8.tar.xz
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
Diffstat (limited to 'src/crypto/hash.h')
-rw-r--r--src/crypto/hash.h6
1 files changed, 5 insertions, 1 deletions
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<char *>(&hash), variant);
+ cn_slow_hash(data, length, reinterpret_cast<char *>(&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<char *>(&hash), variant, 1/*prehashed*/);
}
inline void tree_hash(const hash *hashes, std::size_t count, hash &root_hash) {