]> git.codecow.com Git - Monocypher.git/commitdiff
added blake2b benchmark
authorLoup Vaillant <loup@loup-vaillant.fr>
Tue, 27 Sep 2016 17:50:20 +0000 (19:50 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Tue, 27 Sep 2016 17:50:20 +0000 (19:50 +0200)
build.sh
speed_blake2b [new file with mode: 0755]
speed_blake2b.c [new file with mode: 0644]

index 0a2e624dedce6346ed2ac7b0d31d7ae2734ab85e..daf37026453346b3cc4238156959cdf6ab1b3d67 100755 (executable)
--- 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 (executable)
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 (file)
index 0000000..83cb2a9
--- /dev/null
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#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;
+}