1
2#include "crypto_shorthash.h"
3#include "randombytes.h"
4
5size_t
6crypto_shorthash_bytes(void)
7{
8    return crypto_shorthash_BYTES;
9}
10
11size_t
12crypto_shorthash_keybytes(void)
13{
14    return crypto_shorthash_KEYBYTES;
15}
16
17const char *
18crypto_shorthash_primitive(void)
19{
20    return crypto_shorthash_PRIMITIVE;
21}
22
23int
24crypto_shorthash(unsigned char *out, const unsigned char *in,
25                 unsigned long long inlen, const unsigned char *k)
26{
27    return crypto_shorthash_siphash24(out, in, inlen, k);
28}
29
30void
31crypto_shorthash_keygen(unsigned char k[crypto_shorthash_KEYBYTES])
32{
33    randombytes_buf(k, crypto_shorthash_KEYBYTES);
34}
35