diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-18 23:29:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-18 23:29:42 +0100 |
commit | 2c87c3c20472f1217c33bfa33bc5ecec2daff6a3 (patch) | |
tree | 18b19c1acbd30690ad99f6d07ffbba66dfdd9105 /test | |
parent | b7efc8479526b5f1f10e1df9659f393adfac08c7 (diff) | |
download | rspamd-2c87c3c20472f1217c33bfa33bc5ecec2daff6a3.tar.gz rspamd-2c87c3c20472f1217c33bfa33bc5ecec2daff6a3.zip |
Enable openssl AES tests
Diffstat (limited to 'test')
-rw-r--r-- | test/rspamd_cryptobox_test.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/rspamd_cryptobox_test.c b/test/rspamd_cryptobox_test.c index d01d99ee3..97a21ec48 100644 --- a/test/rspamd_cryptobox_test.c +++ b/test/rspamd_cryptobox_test.c @@ -172,6 +172,7 @@ rspamd_cryptobox_test_func (void) struct rspamd_cryptobox_segment *seg; double t1, t2; gint i, cnt, ms; + gboolean checked_openssl = FALSE; map = create_mapping (mapping_size, &begin, &end); @@ -188,6 +189,22 @@ rspamd_cryptobox_test_func (void) check_result (key, nonce, mac, begin, end); msg_info ("baseline encryption: %.6f", t2 - t1); + + if (rspamd_cryptobox_openssl_mode (TRUE)) { + t1 = rspamd_get_ticks (); + rspamd_cryptobox_encrypt_nm_inplace (begin, + end - begin, + nonce, + key, + mac); + t2 = rspamd_get_ticks (); + check_result (key, nonce, mac, begin, end); + + msg_info ("openssl baseline encryption: %.6f", t2 - t1); + rspamd_cryptobox_openssl_mode (FALSE); + } + +start: /* A single chunk as vector */ seg[0].data = begin; seg[0].len = end - begin; @@ -330,4 +347,9 @@ rspamd_cryptobox_test_func (void) msg_info ("constrainted fuzz iterations: %d", i); } } + + if (!checked_openssl && rspamd_cryptobox_openssl_mode (TRUE)) { + checked_openssl = TRUE; + goto start; + } } |