2913319685533a3532f48ab84c12e632e13c63a7
[trex.git] /
1 #ifndef crypto_stream_aes128ctr_H
2 #define crypto_stream_aes128ctr_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_aes128ctr_KEYBYTES 16U
23 SODIUM_EXPORT
24 size_t crypto_stream_aes128ctr_keybytes(void);
25
26 #define crypto_stream_aes128ctr_NONCEBYTES 16U
27 SODIUM_EXPORT
28 size_t crypto_stream_aes128ctr_noncebytes(void);
29
30 #define crypto_stream_aes128ctr_BEFORENMBYTES 1408U
31 SODIUM_EXPORT
32 size_t crypto_stream_aes128ctr_beforenmbytes(void);
33
34 SODIUM_EXPORT
35 int crypto_stream_aes128ctr(unsigned char *out, unsigned long long outlen,
36                             const unsigned char *n, const unsigned char *k);
37
38 SODIUM_EXPORT
39 int crypto_stream_aes128ctr_xor(unsigned char *out, const unsigned char *in,
40                                 unsigned long long inlen, const unsigned char *n,
41                                 const unsigned char *k);
42
43 SODIUM_EXPORT
44 int crypto_stream_aes128ctr_beforenm(unsigned char *c, const unsigned char *k);
45
46 SODIUM_EXPORT
47 int crypto_stream_aes128ctr_afternm(unsigned char *out, unsigned long long len,
48                                     const unsigned char *nonce, const unsigned char *c);
49
50 SODIUM_EXPORT
51 int crypto_stream_aes128ctr_xor_afternm(unsigned char *out, const unsigned char *in,
52                                         unsigned long long len,
53                                         const unsigned char *nonce,
54                                         const unsigned char *c);
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif