libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / crypto_box / crypto_box.c
blob7ec820a48a24301189a765617179b811f562a616
2 #include "crypto_box.h"
4 size_t
5 crypto_box_publickeybytes(void)
7 return crypto_box_PUBLICKEYBYTES;
10 size_t
11 crypto_box_secretkeybytes(void)
13 return crypto_box_SECRETKEYBYTES;
16 size_t
17 crypto_box_beforenmbytes(void)
19 return crypto_box_BEFORENMBYTES;
22 size_t
23 crypto_box_noncebytes(void)
25 return crypto_box_NONCEBYTES;
28 size_t
29 crypto_box_zerobytes(void)
31 return crypto_box_ZEROBYTES;
34 size_t
35 crypto_box_boxzerobytes(void)
37 return crypto_box_BOXZEROBYTES;
40 size_t
41 crypto_box_macbytes(void)
43 return crypto_box_MACBYTES;
46 const char *
47 crypto_box_primitive(void)
49 return crypto_box_PRIMITIVE;
52 int
53 crypto_box_keypair(unsigned char *pk, unsigned char *sk)
55 return crypto_box_curve25519xsalsa20poly1305_keypair(pk, sk);
58 int
59 crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
60 const unsigned char *sk)
62 return crypto_box_curve25519xsalsa20poly1305_beforenm(k, pk, sk);
65 int
66 crypto_box_afternm(unsigned char *c, const unsigned char *m,
67 unsigned long long mlen, const unsigned char *n,
68 const unsigned char *k)
70 return crypto_box_curve25519xsalsa20poly1305_afternm(c, m, mlen, n, k);
73 int
74 crypto_box_open_afternm(unsigned char *m, const unsigned char *c,
75 unsigned long long clen, const unsigned char *n,
76 const unsigned char *k)
78 return crypto_box_curve25519xsalsa20poly1305_open_afternm(m, c, clen, n, k);
81 int
82 crypto_box(unsigned char *c, const unsigned char *m,
83 unsigned long long mlen, const unsigned char *n,
84 const unsigned char *pk, const unsigned char *sk)
86 return crypto_box_curve25519xsalsa20poly1305(c, m, mlen, n, pk, sk);
89 int
90 crypto_box_open(unsigned char *m, const unsigned char *c,
91 unsigned long long clen, const unsigned char *n,
92 const unsigned char *pk, const unsigned char *sk)
94 return crypto_box_curve25519xsalsa20poly1305_open(m, c, clen, n, pk, sk);