crypto_stream_salsa208.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef crypto_stream_salsa208_H
  2. #define crypto_stream_salsa208_H
  3. /*
  4. * WARNING: This is just a stream cipher. It is NOT authenticated encryption.
  5. * While it provides some protection against eavesdropping, it does NOT
  6. * provide any security against active attacks.
  7. * Unless you know what you're doing, what you are looking for is probably
  8. * the crypto_box functions.
  9. */
  10. #include <stddef.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_stream_salsa208_KEYBYTES 32U
  19. SODIUM_EXPORT
  20. size_t crypto_stream_salsa208_keybytes(void)
  21. __attribute__ ((deprecated));
  22. #define crypto_stream_salsa208_NONCEBYTES 8U
  23. SODIUM_EXPORT
  24. size_t crypto_stream_salsa208_noncebytes(void)
  25. __attribute__ ((deprecated));
  26. #define crypto_stream_salsa208_MESSAGEBYTES_MAX SODIUM_SIZE_MAX
  27. SODIUM_EXPORT
  28. size_t crypto_stream_salsa208_messagebytes_max(void)
  29. __attribute__ ((deprecated));
  30. SODIUM_EXPORT
  31. int crypto_stream_salsa208(unsigned char *c, unsigned long long clen,
  32. const unsigned char *n, const unsigned char *k)
  33. __attribute__ ((deprecated)) __attribute__ ((nonnull));
  34. SODIUM_EXPORT
  35. int crypto_stream_salsa208_xor(unsigned char *c, const unsigned char *m,
  36. unsigned long long mlen, const unsigned char *n,
  37. const unsigned char *k)
  38. __attribute__ ((deprecated)) __attribute__ ((nonnull));
  39. SODIUM_EXPORT
  40. void crypto_stream_salsa208_keygen(unsigned char k[crypto_stream_salsa208_KEYBYTES])
  41. __attribute__ ((deprecated)) __attribute__ ((nonnull));
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif