crypto_auth.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef crypto_auth_H
  2. #define crypto_auth_H
  3. #include <stddef.h>
  4. #include "crypto_auth_hmacsha512256.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_BYTES crypto_auth_hmacsha512256_BYTES
  13. SODIUM_EXPORT
  14. size_t crypto_auth_bytes(void);
  15. #define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES
  16. SODIUM_EXPORT
  17. size_t crypto_auth_keybytes(void);
  18. #define crypto_auth_PRIMITIVE "hmacsha512256"
  19. SODIUM_EXPORT
  20. const char *crypto_auth_primitive(void);
  21. SODIUM_EXPORT
  22. int crypto_auth(unsigned char *out, const unsigned char *in,
  23. unsigned long long inlen, const unsigned char *k)
  24. __attribute__ ((nonnull(1, 4)));
  25. SODIUM_EXPORT
  26. int crypto_auth_verify(const unsigned char *h, const unsigned char *in,
  27. unsigned long long inlen, const unsigned char *k)
  28. __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
  29. SODIUM_EXPORT
  30. void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES])
  31. __attribute__ ((nonnull));
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif