diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-08 13:41:45 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-08 13:49:52 +0000 |
commit | 84793e0fe51a1ddd9b3c1be69f50a8251ceb92b7 (patch) | |
tree | 3f9371a72edd2b63e4dc2b116c8c4731108d33f7 /src/libcryptobox | |
parent | 2aff8dd1681d4b8d01e2c4be68243ff5b2b9a0a8 (diff) | |
download | rspamd-84793e0fe51a1ddd9b3c1be69f50a8251ceb92b7.tar.gz rspamd-84793e0fe51a1ddd9b3c1be69f50a8251ceb92b7.zip |
[Feature] Use t1ha instead of metrohash and xxhash32
Diffstat (limited to 'src/libcryptobox')
-rw-r--r-- | src/libcryptobox/cryptobox.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c index e8bd962b7..3098cd966 100644 --- a/src/libcryptobox/cryptobox.c +++ b/src/libcryptobox/cryptobox.c @@ -34,7 +34,7 @@ #include "xxhash.h" #define MUM_TARGET_INDEPENDENT_HASH 1 /* For 32/64 bit equal hashes */ #include "../../contrib/mumhash/mum.h" -#include "../../contrib/metrohash/metro.h" +#include "../../contrib/t1ha/t1ha.h" #ifdef HAVE_CPUID_H #include <cpuid.h> #endif @@ -1498,27 +1498,18 @@ static inline guint64 rspamd_cryptobox_fast_hash_machdep (const void *data, gsize len, guint64 seed) { - if (len >= 8 && len % 8 == 0) { - return mum_hash (data, len, seed); - } - else { #if defined(__LP64__) || defined(_LP64) - return metrohash64_1 (data, len, seed); + return t1ha (data, len, seed); +#else + return t1ha32 (data, len, seed); #endif - } - - return XXH32 (data, len, seed); } static inline guint64 rspamd_cryptobox_fast_hash_indep (const void *data, gsize len, guint64 seed) { - if (len >= 8 && len % 8 == 0) { - return mum_hash (data, len, seed); - } - - return metrohash64_1 (data, len, seed); + return t1ha (data, len, seed); } guint64 |