crypto_auth_hmacsha512256.h (2133B)
1 #ifndef crypto_auth_hmacsha512256_H 2 #define crypto_auth_hmacsha512256_H 3 4 #include <stddef.h> 5 #include "crypto_auth_hmacsha512.h" 6 #include "export.h" 7 8 #ifdef __cplusplus 9 # ifdef __GNUC__ 10 # pragma GCC diagnostic ignored "-Wlong-long" 11 # endif 12 extern "C" { 13 #endif 14 15 #define crypto_auth_hmacsha512256_BYTES 32U 16 SODIUM_EXPORT 17 size_t crypto_auth_hmacsha512256_bytes(void); 18 19 #define crypto_auth_hmacsha512256_KEYBYTES 32U 20 SODIUM_EXPORT 21 size_t crypto_auth_hmacsha512256_keybytes(void); 22 23 SODIUM_EXPORT 24 int crypto_auth_hmacsha512256(unsigned char *out, 25 const unsigned char *in, 26 unsigned long long inlen, 27 const unsigned char *k) __attribute__ ((nonnull(1, 4))); 28 29 SODIUM_EXPORT 30 int crypto_auth_hmacsha512256_verify(const unsigned char *h, 31 const unsigned char *in, 32 unsigned long long inlen, 33 const unsigned char *k) 34 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4))); 35 36 /* ------------------------------------------------------------------------- */ 37 38 typedef crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state; 39 40 SODIUM_EXPORT 41 size_t crypto_auth_hmacsha512256_statebytes(void); 42 43 SODIUM_EXPORT 44 int crypto_auth_hmacsha512256_init(crypto_auth_hmacsha512256_state *state, 45 const unsigned char *key, 46 size_t keylen) __attribute__ ((nonnull)); 47 48 SODIUM_EXPORT 49 int crypto_auth_hmacsha512256_update(crypto_auth_hmacsha512256_state *state, 50 const unsigned char *in, 51 unsigned long long inlen) __attribute__ ((nonnull(1))); 52 53 SODIUM_EXPORT 54 int crypto_auth_hmacsha512256_final(crypto_auth_hmacsha512256_state *state, 55 unsigned char *out) __attribute__ ((nonnull)); 56 57 SODIUM_EXPORT 58 void crypto_auth_hmacsha512256_keygen(unsigned char k[crypto_auth_hmacsha512256_KEYBYTES]) 59 __attribute__ ((nonnull)); 60 61 #ifdef __cplusplus 62 } 63 #endif 64 65 #endif