From: Loup Vaillant Date: Tue, 27 Sep 2016 17:50:20 +0000 (+0200) Subject: added blake2b benchmark X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=c97d369b976264b38e31fcc1a86896048328d735;p=Monocypher.git added blake2b benchmark --- diff --git a/build.sh b/build.sh index 0a2e624..daf3702 100755 --- a/build.sh +++ b/build.sh @@ -8,3 +8,4 @@ $CC $CFLAGS -c blake2b.c $CC $CFLAGS -c test.c $CC $CFLAGS -o test test.o chacha20.o blake2b.o +$CC $CFLAGS -o speed_blake2b speed_blake2b.c blake2b.o diff --git a/speed_blake2b b/speed_blake2b new file mode 100755 index 0000000..dac50c7 Binary files /dev/null and b/speed_blake2b differ diff --git a/speed_blake2b.c b/speed_blake2b.c new file mode 100644 index 0000000..83cb2a9 --- /dev/null +++ b/speed_blake2b.c @@ -0,0 +1,17 @@ +#include +#include "blake2b.h" + +int main() +{ + crypto_blake2b_ctx ctx; + crypto_blake2b_init(&ctx); + uint8_t input[128]; + for (unsigned i = 0; i < 128; i++) { + input[i] = i; + } + for (unsigned i = 0; i < 5000000; i++) { + crypto_blake2b_update(&ctx, input, 128); + + } + return 0; +}