diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-12-19 10:55:06 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-12-19 10:55:06 +0000 |
commit | a13bc71723ef269d7dcee56416a5f42cd8ee8a72 (patch) | |
tree | 8d67fd569b447604469d29c92de44f66e790f694 /src/libutil/shingles.c | |
parent | 918031c506cd7e229578fdcb11c0289938205813 (diff) | |
download | rspamd-a13bc71723ef269d7dcee56416a5f42cd8ee8a72.tar.gz rspamd-a13bc71723ef269d7dcee56416a5f42cd8ee8a72.zip |
Resize hashes array properly.
Diffstat (limited to 'src/libutil/shingles.c')
-rw-r--r-- | src/libutil/shingles.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/shingles.c b/src/libutil/shingles.c index 6d33c7f26..9421c1529 100644 --- a/src/libutil/shingles.c +++ b/src/libutil/shingles.c @@ -69,7 +69,7 @@ rspamd_shingles_generate (GArray *input, /* Init hashes pipes and keys */ for (i = 0; i < RSPAMD_SHINGLE_SIZE; i ++) { hashes[i] = g_array_sized_new (FALSE, FALSE, sizeof (guint64), - SHINGLES_WINDOW * 2); + input->len + SHINGLES_WINDOW); /* * To generate a set of hashes we just apply sha256 to the * initial key as many times as many hashes are required and @@ -80,7 +80,7 @@ rspamd_shingles_generate (GArray *input, blake2b_final (&bs, shabuf, shalen); for (j = 0; j < 16; j ++) { - out_key[j] = shabuf[j] ^ shabuf[sizeof(shabuf) - j - 1]; + out_key[j] = shabuf[j]; } blake2b_init (&bs, BLAKE2B_OUTBYTES); cur_key = out_key; |