aboutsummaryrefslogtreecommitdiffstats
path: root/test/rspamd_cryptobox_test.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-18 23:29:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-18 23:29:42 +0100
commit2c87c3c20472f1217c33bfa33bc5ecec2daff6a3 (patch)
tree18b19c1acbd30690ad99f6d07ffbba66dfdd9105 /test/rspamd_cryptobox_test.c
parentb7efc8479526b5f1f10e1df9659f393adfac08c7 (diff)
downloadrspamd-2c87c3c20472f1217c33bfa33bc5ecec2daff6a3.tar.gz
rspamd-2c87c3c20472f1217c33bfa33bc5ecec2daff6a3.zip
Enable openssl AES tests
Diffstat (limited to 'test/rspamd_cryptobox_test.c')
-rw-r--r--test/rspamd_cryptobox_test.c22
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;
+ }
}