From 7f238c259982f77140fad2f1a6fa389bf2af51ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Mon, 15 Jul 2019 10:23:41 +0000 Subject: [PATCH] Bench chacha if aes is not supported and not asked MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- src/bench.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bench.c b/src/bench.c index 4b10bd6..2e10f68 100644 --- a/src/bench.c +++ b/src/bench.c @@ -65,11 +65,15 @@ gt_bench(int argc, char **argv) duration /= 1000; int term = isatty(1); + int aes = argz_is_set(bench_argz, "aes"); int chacha = argz_is_set(bench_argz, "chacha"); - if (!chacha && !crypto_aead_aes256gcm_is_available()) { - gt_log("aes is not available on your platform\n"); - return 1; + if (!crypto_aead_aes256gcm_is_available()) { + if (aes) { + gt_log("aes is not available on your platform\n"); + return 1; + } + chacha = 1; } unsigned char *buf = calloc(1, bufsize + crypto_aead_aes256gcm_ABYTES);