crypto_hash.h 941 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef crypto_hash_H
  2. #define crypto_hash_H
  3. /*
  4. * WARNING: Unless you absolutely need to use SHA512 for interoperatibility,
  5. * purposes, you might want to consider crypto_generichash() instead.
  6. * Unlike SHA512, crypto_generichash() is not vulnerable to length
  7. * extension attacks.
  8. */
  9. #include <stddef.h>
  10. #include "crypto_hash_sha512.h"
  11. #include "export.h"
  12. #ifdef __cplusplus
  13. # ifdef __GNUC__
  14. # pragma GCC diagnostic ignored "-Wlong-long"
  15. # endif
  16. extern "C" {
  17. #endif
  18. #define crypto_hash_BYTES crypto_hash_sha512_BYTES
  19. SODIUM_EXPORT
  20. size_t crypto_hash_bytes(void);
  21. SODIUM_EXPORT
  22. int crypto_hash(unsigned char *out, const unsigned char *in,
  23. unsigned long long inlen) __attribute__ ((nonnull(1)));
  24. #define crypto_hash_PRIMITIVE "sha512"
  25. SODIUM_EXPORT
  26. const char *crypto_hash_primitive(void)
  27. __attribute__ ((warn_unused_result));
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif