summaryrefslogtreecommitdiff
path: root/test/default/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/default/hash.c')
-rw-r--r--test/default/hash.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/default/hash.c b/test/default/hash.c
new file mode 100644
index 0000000..c24f9c4
--- /dev/null
+++ b/test/default/hash.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+#define TEST_NAME "hash"
+#include "cmptest.h"
+
+unsigned char x[] = "testing\n";
+unsigned char h[crypto_hash_BYTES];
+
+int main(void)
+{
+ size_t i;
+ crypto_hash(h,x,sizeof x - 1U);
+ for (i = 0;i < crypto_hash_BYTES;++i) printf("%02x",(unsigned int) h[i]);
+ printf("\n");
+ return 0;
+}