1 #ifndef crypto_stream_chacha20_H
2 #define crypto_stream_chacha20_H
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.
18 # pragma GCC diagnostic ignored "-Wlong-long"
23 #define crypto_stream_chacha20_KEYBYTES 32U
25 size_t crypto_stream_chacha20_keybytes(void);
27 #define crypto_stream_chacha20_NONCEBYTES 8U
29 size_t crypto_stream_chacha20_noncebytes(void);
32 int crypto_stream_chacha20(unsigned char *c, unsigned long long clen,
33 const unsigned char *n, const unsigned char *k);
36 int crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m,
37 unsigned long long mlen, const unsigned char *n,
38 const unsigned char *k);
41 int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
42 unsigned long long mlen,
43 const unsigned char *n, uint64_t ic,
44 const unsigned char *k);