libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / test / default / shorthash.c
blob6f1d7f3c2e17d7a883dae67400843c3fdc42c45d
1 #include <stdio.h>
3 #include "crypto_uint8.h"
5 #define TEST_NAME "shorthash"
6 #include "cmptest.h"
8 int main(void)
10 #define MAXLEN 64
11 crypto_uint8 in[MAXLEN], out[crypto_shorthash_BYTES], k[crypto_shorthash_KEYBYTES];
12 size_t i,j;
14 for( i = 0; i < crypto_shorthash_KEYBYTES; ++i ) k[i] = i;
16 for(i=0;i<MAXLEN;++i) {
17 in[i]=i;
18 crypto_shorthash( out, in, i, k );
19 for (j = 0;j < crypto_shorthash_BYTES;++j) printf("%02x",(unsigned int) out[j]);
20 printf("\n");
22 return 0;