From: Loup Vaillant Date: Mon, 4 Sep 2017 06:55:05 +0000 (+0200) Subject: Properly initialise libsodium for the speed benchmarks X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=cb0de26db3ef83a900e6caa6949e4958b3c13726;p=Monocypher.git Properly initialise libsodium for the speed benchmarks Without this initialisation, libsodium can't select the fastest implementation for the platform, and has to revert to a portable, slower one. This leads to misleading benchmarks. --- diff --git a/tests/speed.c b/tests/speed.c index 4fc506b..19d3ef4 100644 --- a/tests/speed.c +++ b/tests/speed.c @@ -480,6 +480,10 @@ static void d_ed25519(void) int main() { + if (sodium_init() == -1) { + printf("Libsodium init failed. Abort. No test performed\n"); + return 1; + } printf("\nComparing with Libsodium\n"); printf("------------------------\n"); print("Chacha20 ", chacha20(), "Libsodium");