libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / include / sodium / crypto_box.h
bloba2ff0a1e9834ee3f923ebeaecad35b7255331feb
1 #ifndef crypto_box_H
2 #define crypto_box_H
4 /*
5 * THREAD SAFETY: crypto_box_keypair() is thread-safe,
6 * provided that you called sodium_init() once before using any
7 * other libsodium function.
8 * Other functions are always thread-safe.
9 */
11 #include <stddef.h>
13 #include "crypto_box_curve25519xsalsa20poly1305.h"
14 #include "export.h"
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 #define crypto_box_PUBLICKEYBYTES crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES
21 SODIUM_EXPORT
22 size_t crypto_box_publickeybytes(void);
24 #define crypto_box_SECRETKEYBYTES crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES
25 SODIUM_EXPORT
26 size_t crypto_box_secretkeybytes(void);
28 #define crypto_box_BEFORENMBYTES crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES
29 SODIUM_EXPORT
30 size_t crypto_box_beforenmbytes(void);
32 #define crypto_box_NONCEBYTES crypto_box_curve25519xsalsa20poly1305_NONCEBYTES
33 SODIUM_EXPORT
34 size_t crypto_box_noncebytes(void);
36 #define crypto_box_ZEROBYTES crypto_box_curve25519xsalsa20poly1305_ZEROBYTES
37 SODIUM_EXPORT
38 size_t crypto_box_zerobytes(void);
40 #define crypto_box_BOXZEROBYTES crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES
41 SODIUM_EXPORT
42 size_t crypto_box_boxzerobytes(void);
44 #define crypto_box_MACBYTES crypto_box_curve25519xsalsa20poly1305_MACBYTES
45 SODIUM_EXPORT
46 size_t crypto_box_macbytes(void);
48 #define crypto_box_PRIMITIVE "curve25519xsalsa20poly1305"
49 SODIUM_EXPORT
50 const char *crypto_box_primitive(void);
52 SODIUM_EXPORT
53 int crypto_box_keypair(unsigned char *pk, unsigned char *sk);
55 SODIUM_EXPORT
56 int crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
57 const unsigned char *sk);
59 SODIUM_EXPORT
60 int crypto_box_afternm(unsigned char *c, const unsigned char *m,
61 unsigned long long mlen, const unsigned char *n,
62 const unsigned char *k);
64 SODIUM_EXPORT
65 int crypto_box_open_afternm(unsigned char *m, const unsigned char *c,
66 unsigned long long clen, const unsigned char *n,
67 const unsigned char *k);
69 SODIUM_EXPORT
70 int crypto_box(unsigned char *c, const unsigned char *m,
71 unsigned long long mlen, const unsigned char *n,
72 const unsigned char *pk, const unsigned char *sk);
74 SODIUM_EXPORT
75 int crypto_box_open(unsigned char *m, const unsigned char *c,
76 unsigned long long clen, const unsigned char *n,
77 const unsigned char *pk, const unsigned char *sk);
79 #ifdef __cplusplus
81 #endif
83 #endif