crypto_auth_hmacsha512256.h 2.1 KB

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