libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / crypto_generichash / crypto_generichash.c
blobe418a94a245fcd466b78ade6f99ca782d1aecd92
2 #include "crypto_generichash.h"
4 size_t
5 crypto_generichash_bytes(void)
7 return crypto_generichash_BYTES;
10 size_t
11 crypto_generichash_bytes_min(void)
13 return crypto_generichash_BYTES_MIN;
16 size_t
17 crypto_generichash_bytes_max(void)
19 return crypto_generichash_BYTES_MAX;
22 size_t
23 crypto_generichash_keybytes(void)
25 return crypto_generichash_KEYBYTES;
28 size_t
29 crypto_generichash_keybytes_min(void)
31 return crypto_generichash_KEYBYTES_MIN;
34 size_t
35 crypto_generichash_keybytes_max(void)
37 return crypto_generichash_KEYBYTES_MAX;
40 size_t
41 crypto_generichash_blockbytes(void)
43 return crypto_generichash_BLOCKBYTES;
46 const char *crypto_generichash_primitive(void)
48 return crypto_generichash_PRIMITIVE;
51 int
52 crypto_generichash(unsigned char *out, size_t outlen, const unsigned char *in,
53 unsigned long long inlen, const unsigned char *key,
54 size_t keylen)
56 return crypto_generichash_blake2b(out, outlen, in, inlen, key, keylen);
59 int
60 crypto_generichash_init(crypto_generichash_state *state,
61 const unsigned char *key,
62 const size_t keylen, const size_t outlen)
64 return crypto_generichash_blake2b_init
65 ((crypto_generichash_blake2b_state *) state,
66 key, keylen, outlen);
69 int
70 crypto_generichash_update(crypto_generichash_state *state,
71 const unsigned char *in,
72 unsigned long long inlen)
74 return crypto_generichash_blake2b_update
75 ((crypto_generichash_blake2b_state *) state, in, inlen);
78 int
79 crypto_generichash_final(crypto_generichash_state *state,
80 unsigned char *out, const size_t outlen)
82 return crypto_generichash_blake2b_final
83 ((crypto_generichash_blake2b_state *) state, out, outlen);