a8fd2cef81a0dbbba0a63a5fd6f35ca813fde1fd
[trex.git] /
1 #ifndef crypto_stream_salsa208_H
2 #define crypto_stream_salsa208_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 # if __GNUC__
17 #  pragma GCC diagnostic ignored "-Wlong-long"
18 # endif
19 extern "C" {
20 #endif
21
22 #define crypto_stream_salsa208_KEYBYTES 32U
23 SODIUM_EXPORT
24 size_t crypto_stream_salsa208_keybytes(void);
25
26 #define crypto_stream_salsa208_NONCEBYTES 8U
27 SODIUM_EXPORT
28 size_t crypto_stream_salsa208_noncebytes(void);
29
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
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
39 #ifdef __cplusplus
40 }
41 #endif
42
43 #endif