xref: /freebsd/sys/contrib/libsodium/test/default/hash3.c (revision 3611ec604864a7d4dcc9a3ea898c80eb35eef8a0)
1*0ac341f1SConrad Meyer 
2*0ac341f1SConrad Meyer #define TEST_NAME "hash3"
3*0ac341f1SConrad Meyer #include "cmptest.h"
4*0ac341f1SConrad Meyer 
5*0ac341f1SConrad Meyer static unsigned char x[] = "testing\n";
6*0ac341f1SConrad Meyer static unsigned char h[crypto_hash_BYTES];
7*0ac341f1SConrad Meyer 
8*0ac341f1SConrad Meyer int
main(void)9*0ac341f1SConrad Meyer main(void)
10*0ac341f1SConrad Meyer {
11*0ac341f1SConrad Meyer     size_t i;
12*0ac341f1SConrad Meyer 
13*0ac341f1SConrad Meyer     crypto_hash(h, x, sizeof x - 1U);
14*0ac341f1SConrad Meyer     for (i = 0; i < crypto_hash_BYTES; ++i) {
15*0ac341f1SConrad Meyer         printf("%02x", (unsigned int) h[i]);
16*0ac341f1SConrad Meyer     }
17*0ac341f1SConrad Meyer     printf("\n");
18*0ac341f1SConrad Meyer 
19*0ac341f1SConrad Meyer     return 0;
20*0ac341f1SConrad Meyer }
21