1
0
Fork 0
forked from lthn/blockchain

crypto: cn_fast_hash is a bit more faster now

This commit is contained in:
sowle 2021-04-22 01:34:51 +03:00
parent 8ac3432dcb
commit 7fb643d894
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 9 additions and 2 deletions

View file

@ -52,8 +52,8 @@ void hash_process(union hash_state *state, const uint8_t *buf, size_t count);
#define HASH_DATA_AREA 136
void cn_fast_hash_old(const void *data, size_t length, char *hash);
void cn_fast_hash(const void *data, size_t length, char *hash);
//void cn_slow_hash(const void *data, size_t length, char *hash);
void hash_extra_blake(const void *data, size_t length, char *hash);
void hash_extra_groestl(const void *data, size_t length, char *hash);

View file

@ -1,3 +1,4 @@
// Copyright (c) 2020-2021 Zano project
// Copyright (c) 2012-2013 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@ -17,8 +18,14 @@ void hash_process(union hash_state *state, const uint8_t *buf, size_t count) {
keccak1600(buf, (int)count, (uint8_t*)state);
}
void cn_fast_hash(const void *data, size_t length, char *hash) {
void cn_fast_hash_old(const void *data, size_t length, char *hash)
{
union hash_state state;
hash_process(&state, data, length);
memcpy(hash, &state, HASH_SIZE);
}
void cn_fast_hash(const void *data, size_t length, char *hash)
{
keccak(data, (int)length, hash, HASH_SIZE);
}