libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / crypto_box / curve25519xsalsa20poly1305 / ref / box_curve25519xsalsa20poly1305.c
blob4b75ece82e3e6b770353633fd8ea24b34afc71b1
1 #include "api.h"
3 int crypto_box(
4 unsigned char *c,
5 const unsigned char *m,unsigned long long mlen,
6 const unsigned char *n,
7 const unsigned char *pk,
8 const unsigned char *sk
11 unsigned char k[crypto_box_BEFORENMBYTES];
12 crypto_box_beforenm(k,pk,sk);
13 return crypto_box_afternm(c,m,mlen,n,k);
16 int crypto_box_open(
17 unsigned char *m,
18 const unsigned char *c,unsigned long long clen,
19 const unsigned char *n,
20 const unsigned char *pk,
21 const unsigned char *sk
24 unsigned char k[crypto_box_BEFORENMBYTES];
25 crypto_box_beforenm(k,pk,sk);
26 return crypto_box_open_afternm(m,c,clen,n,k);