1 /*******************************************************************************
2 
3     D language bindings for libsodium's crypto_auth_hmacsha512.h
4 
5     License: ISC (see LICENSE.txt)
6 
7 *******************************************************************************/
8 
9 module libsodium.crypto_auth_hmacsha512;
10 
11 @nogc nothrow:
12 
13 import libsodium.export_;
14 import libsodium.crypto_hash_sha512;
15 
16 extern (C):
17 
18 enum crypto_auth_hmacsha512_BYTES = 64U;
19 size_t crypto_auth_hmacsha512_bytes ();
20 
21 enum crypto_auth_hmacsha512_KEYBYTES = 32U;
22 size_t crypto_auth_hmacsha512_keybytes ();
23 
24 int crypto_auth_hmacsha512 (
25     ubyte* out_,
26     const(ubyte)* in_,
27     ulong inlen,
28     const(ubyte)* k);
29 
30 int crypto_auth_hmacsha512_verify (
31     const(ubyte)* h,
32     const(ubyte)* in_,
33     ulong inlen,
34     const(ubyte)* k);
35 
36 /* ------------------------------------------------------------------------- */
37 
38 struct crypto_auth_hmacsha512_state
39 {
40     crypto_hash_sha512_state ictx;
41     crypto_hash_sha512_state octx;
42 }
43 
44 size_t crypto_auth_hmacsha512_statebytes ();
45 
46 int crypto_auth_hmacsha512_init (
47     crypto_auth_hmacsha512_state* state,
48     const(ubyte)* key,
49     size_t keylen);
50 
51 int crypto_auth_hmacsha512_update (
52     crypto_auth_hmacsha512_state* state,
53     const(ubyte)* in_,
54     ulong inlen);
55 
56 int crypto_auth_hmacsha512_final (
57     crypto_auth_hmacsha512_state* state,
58     ubyte* out_);
59 
60 void crypto_auth_hmacsha512_keygen (
61     ref ubyte[crypto_auth_hmacsha512_KEYBYTES] k);