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
This commit is contained in:
stoffu 2018-03-05 18:24:11 +09:00
parent b2d23b189e
commit 7dfa5e9e6e
No known key found for this signature in database
GPG key ID: 41DAB8343A9EC012
6 changed files with 38 additions and 20 deletions

View file

@ -52,10 +52,10 @@ extern "C" {
tree_hash((const char (*)[32]) data, length >> 5, hash);
}
static void cn_slow_hash_0(const void *data, size_t length, char *hash) {
return cn_slow_hash(data, length, hash, 0);
return cn_slow_hash(data, length, hash, 0/*variant*/, 0/*prehashed*/);
}
static void cn_slow_hash_1(const void *data, size_t length, char *hash) {
return cn_slow_hash(data, length, hash, 1);
return cn_slow_hash(data, length, hash, 1/*variant*/, 0/*prehashed*/);
}
}
POP_WARNINGS