Changes to update Tomato RAF.
[tomato.git] / release / src / router / dnscrypt / src / libnacl / crypto_stream / xsalsa20 / ref / xor.c
blob13f3134a44297d9dcb02b90f6c41b75e56fa2d07
1 /*
2 version 20080913
3 D. J. Bernstein
4 Public domain.
5 */
7 #include "crypto_core_hsalsa20.h"
8 #include "crypto_stream_salsa20.h"
9 #include "crypto_stream.h"
11 static const unsigned char sigma[16] = "expand 32-byte k";
13 int crypto_stream_xor(
14 unsigned char *c,
15 const unsigned char *m,unsigned long long mlen,
16 const unsigned char *n,
17 const unsigned char *k
20 unsigned char subkey[32];
21 crypto_core_hsalsa20(subkey,n,k,sigma);
22 return crypto_stream_salsa20_xor(c,m,mlen,n + 16,subkey);