diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-10 16:38:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-10 16:38:43 +0100 |
commit | 952185f2b093374b878db91eafa5cbfa0777c100 (patch) | |
tree | 3f5a2aaa40edcf100b4c7b2641f369fdd0c9ed70 /src/libmime/message.c | |
parent | d96c3b80561784386ba83f1421f091a65a8341ab (diff) | |
download | rspamd-952185f2b093374b878db91eafa5cbfa0777c100.tar.gz rspamd-952185f2b093374b878db91eafa5cbfa0777c100.zip |
[Feature] New abstract hashing API in cryptobox
Diffstat (limited to 'src/libmime/message.c')
-rw-r--r-- | src/libmime/message.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index 4877fde9f..d1fca6b87 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -24,7 +24,7 @@ #include "email_addr.h" #include "utlist.h" #include "tokenizers/tokenizers.h" -#include "xxhash.h" +#include "cryptobox.h" #ifdef WITH_SNOWBALL #include "libstemmer.h" @@ -42,6 +42,7 @@ static const gchar gtube_pattern[] = "XJS*C4JDBQADN1.NSBN3*2IDNEN*" "GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X"; static rspamd_regexp_t *utf_compatible_re = NULL; +static const guint64 words_hash_seed = 0xdeadbabe; static GQuark rspamd_message_quark (void) @@ -1074,7 +1075,12 @@ rspamd_normalize_text_part (struct rspamd_task *task, } if (w->len > 0) { - h = XXH64 (w->begin, w->len, rspamd_hash_seed ()); + /* + * We use static hash seed if we would want to use that in shingles + * computation in future + */ + h = rspamd_cryptobox_fast_hash_specific (RSPAMD_CRYPTOBOX_XXHASH64, + w->begin, w->len, words_hash_seed); g_array_append_val (part->normalized_hashes, h); } } |