crypto_onetimeauth.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef crypto_onetimeauth_H
  2. #define crypto_onetimeauth_H
  3. #include <stddef.h>
  4. #include "crypto_onetimeauth_poly1305.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. typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state;
  13. SODIUM_EXPORT
  14. size_t crypto_onetimeauth_statebytes(void);
  15. #define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES
  16. SODIUM_EXPORT
  17. size_t crypto_onetimeauth_bytes(void);
  18. #define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES
  19. SODIUM_EXPORT
  20. size_t crypto_onetimeauth_keybytes(void);
  21. #define crypto_onetimeauth_PRIMITIVE "poly1305"
  22. SODIUM_EXPORT
  23. const char *crypto_onetimeauth_primitive(void);
  24. SODIUM_EXPORT
  25. int crypto_onetimeauth(unsigned char *out, const unsigned char *in,
  26. unsigned long long inlen, const unsigned char *k)
  27. __attribute__ ((nonnull(1, 4)));
  28. SODIUM_EXPORT
  29. int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
  30. unsigned long long inlen, const unsigned char *k)
  31. __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
  32. SODIUM_EXPORT
  33. int crypto_onetimeauth_init(crypto_onetimeauth_state *state,
  34. const unsigned char *key) __attribute__ ((nonnull));
  35. SODIUM_EXPORT
  36. int crypto_onetimeauth_update(crypto_onetimeauth_state *state,
  37. const unsigned char *in,
  38. unsigned long long inlen)
  39. __attribute__ ((nonnull(1)));
  40. SODIUM_EXPORT
  41. int crypto_onetimeauth_final(crypto_onetimeauth_state *state,
  42. unsigned char *out) __attribute__ ((nonnull));
  43. SODIUM_EXPORT
  44. void crypto_onetimeauth_keygen(unsigned char k[crypto_onetimeauth_KEYBYTES])
  45. __attribute__ ((nonnull));
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif