diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-04-08 13:05:55 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-04-08 13:05:55 +0100 |
commit | 639c8e49fdf60966c5a75899efbb65084a099998 (patch) | |
tree | ebd4fb9d1f87303ada7856c0a44fd7636f17374d /test/lua/unit | |
parent | 185d17a9f91dda3dbd3cb84a3bfc8dc19143b1c6 (diff) | |
download | rspamd-639c8e49fdf60966c5a75899efbb65084a099998.tar.gz rspamd-639c8e49fdf60966c5a75899efbb65084a099998.zip |
Add AVX implementation generated by clang.
Diffstat (limited to 'test/lua/unit')
-rw-r--r-- | test/lua/unit/siphash.lua | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/test/lua/unit/siphash.lua b/test/lua/unit/siphash.lua index 62a30b01a..1c773b45e 100644 --- a/test/lua/unit/siphash.lua +++ b/test/lua/unit/siphash.lua @@ -3,12 +3,27 @@ context("Siphash check functions", function() local ffi = require("ffi") ffi.cdef[[ - size_t siphash24_test(void); + void rspamd_cryptobox_init (void); + size_t siphash24_test(bool generic); + double rspamd_get_ticks (void); ]] - - test("Siphash test vectors", function() - local res = ffi.C.siphash24_test() + + ffi.C.rspamd_cryptobox_init() + + test("Siphash test reference vectors", function() + local t1 = ffi.C.rspamd_get_ticks() + local res = ffi.C.siphash24_test(true) + local t2 = ffi.C.rspamd_get_ticks() + + print("Refrence siphash: " .. tostring(t2 - t1) .. " sec") + assert_not_equal(res, 0) + end) + test("Siphash test optimized vectors", function() + local t1 = ffi.C.rspamd_get_ticks() + local res = ffi.C.siphash24_test(false) + local t2 = ffi.C.rspamd_get_ticks() + print("Optimized siphash: " .. tostring(t2 - t1) .. " sec") assert_not_equal(res, 0) end) end)
\ No newline at end of file |