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.
13 #include "crypto_box_curve25519xsalsa20poly1305.h"
20 #define crypto_box_PUBLICKEYBYTES crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES
22 size_t crypto_box_publickeybytes(void);
24 #define crypto_box_SECRETKEYBYTES crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES
26 size_t crypto_box_secretkeybytes(void);
28 #define crypto_box_BEFORENMBYTES crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES
30 size_t crypto_box_beforenmbytes(void);
32 #define crypto_box_NONCEBYTES crypto_box_curve25519xsalsa20poly1305_NONCEBYTES
34 size_t crypto_box_noncebytes(void);
36 #define crypto_box_ZEROBYTES crypto_box_curve25519xsalsa20poly1305_ZEROBYTES
38 size_t crypto_box_zerobytes(void);
40 #define crypto_box_BOXZEROBYTES crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES
42 size_t crypto_box_boxzerobytes(void);
44 #define crypto_box_MACBYTES crypto_box_curve25519xsalsa20poly1305_MACBYTES
46 size_t crypto_box_macbytes(void);
48 #define crypto_box_PRIMITIVE "curve25519xsalsa20poly1305"
50 const char *crypto_box_primitive(void);
53 int crypto_box_keypair(unsigned char *pk
, unsigned char *sk
);
56 int crypto_box_beforenm(unsigned char *k
, const unsigned char *pk
,
57 const unsigned char *sk
);
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
);
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
);
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
);
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
);