2 #define TEST_NAME "shorthash"
9 unsigned char in
[MAXLEN
];
10 unsigned char out
[crypto_shorthash_BYTES
];
11 unsigned char k
[crypto_shorthash_KEYBYTES
];
15 for (i
= 0; i
< crypto_shorthash_KEYBYTES
; ++i
) {
16 k
[i
] = (unsigned char) i
;
19 for (i
= 0; i
< MAXLEN
; ++i
) {
20 in
[i
] = (unsigned char) i
;
21 crypto_shorthash(out
, in
, (unsigned long long) i
, k
);
22 for (j
= 0; j
< crypto_shorthash_BYTES
; ++j
) {
23 printf("%02x", (unsigned int) out
[j
]);
27 assert(crypto_shorthash_bytes() > 0);
28 assert(crypto_shorthash_keybytes() > 0);
29 assert(strcmp(crypto_shorthash_primitive(), "siphash24") == 0);
30 assert(crypto_shorthash_bytes() == crypto_shorthash_siphash24_bytes());
31 assert(crypto_shorthash_keybytes()
32 == crypto_shorthash_siphash24_keybytes());