Changes to update Tomato RAF.
[tomato.git] / release / src / router / dnscrypt / src / libnacl / crypto_box / curve25519xsalsa20poly1305 / ref / before.c
blob279bb12ad72793292c2d584a6ba282b062aa0aec
1 #include "crypto_core_hsalsa20.h"
2 #include "crypto_scalarmult_curve25519.h"
3 #include "crypto_box.h"
5 static const unsigned char sigma[16] = "expand 32-byte k";
6 static const unsigned char n[16] = {0};
8 int crypto_box_beforenm(
9 unsigned char *k,
10 const unsigned char *pk,
11 const unsigned char *sk
14 unsigned char s[32];
15 crypto_scalarmult_curve25519(s,sk,pk);
16 return crypto_core_hsalsa20(k,n,s,sigma);