crypto_shorthash.h 1001 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef crypto_shorthash_H
  2. #define crypto_shorthash_H
  3. #include <stddef.h>
  4. #include "crypto_shorthash_siphash24.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_shorthash_BYTES crypto_shorthash_siphash24_BYTES
  13. SODIUM_EXPORT
  14. size_t crypto_shorthash_bytes(void);
  15. #define crypto_shorthash_KEYBYTES crypto_shorthash_siphash24_KEYBYTES
  16. SODIUM_EXPORT
  17. size_t crypto_shorthash_keybytes(void);
  18. #define crypto_shorthash_PRIMITIVE "siphash24"
  19. SODIUM_EXPORT
  20. const char *crypto_shorthash_primitive(void);
  21. SODIUM_EXPORT
  22. int crypto_shorthash(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. void crypto_shorthash_keygen(unsigned char k[crypto_shorthash_KEYBYTES])
  27. __attribute__ ((nonnull));
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif