1 #ifndef crypto_stream_salsa2012_H 2 #define crypto_stream_salsa2012_H 3 4 /* 5 * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 6 * While it provides some protection against eavesdropping, it does NOT 7 * provide any security against active attacks. 8 * Unless you know what you're doing, what you are looking for is probably 9 * the crypto_box functions. 10 */ 11 12 #include <stddef.h> 13 #include "export.h" 14 15 #ifdef __cplusplus 16 # ifdef __GNUC__ 17 # pragma GCC diagnostic ignored "-Wlong-long" 18 # endif 19 extern "C" { 20 #endif 21 22 #define crypto_stream_salsa2012_KEYBYTES 32U 23 SODIUM_EXPORT 24 size_t crypto_stream_salsa2012_keybytes(void); 25 26 #define crypto_stream_salsa2012_NONCEBYTES 8U 27 SODIUM_EXPORT 28 size_t crypto_stream_salsa2012_noncebytes(void); 29 30 #define crypto_stream_salsa2012_MESSAGEBYTES_MAX SODIUM_SIZE_MAX 31 SODIUM_EXPORT 32 size_t crypto_stream_salsa2012_messagebytes_max(void); 33 34 SODIUM_EXPORT 35 int crypto_stream_salsa2012(unsigned char *c, unsigned long long clen, 36 const unsigned char *n, const unsigned char *k); 37 38 SODIUM_EXPORT 39 int crypto_stream_salsa2012_xor(unsigned char *c, const unsigned char *m, 40 unsigned long long mlen, const unsigned char *n, 41 const unsigned char *k); 42 43 SODIUM_EXPORT 44 void crypto_stream_salsa2012_keygen(unsigned char k[crypto_stream_salsa2012_KEYBYTES]); 45 46 #ifdef __cplusplus 47 } 48 #endif 49 50 #endif 51