diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index de8d84b7..020600c3 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -118,6 +118,7 @@ libsodium_la_SOURCES = \ crypto_sign/edwards25519sha512batch/ref/sc25519.h \ crypto_sign/edwards25519sha512batch/ref/sc25519_edwards25519sha512batch.c \ crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c \ + crypto_stream/crypto_stream.c \ crypto_stream/aes128ctr/portable/afternm_aes128ctr.c \ crypto_stream/aes128ctr/portable/api.h \ crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c \ diff --git a/src/libsodium/crypto_stream/crypto_stream.c b/src/libsodium/crypto_stream/crypto_stream.c new file mode 100644 index 00000000..8a5f5720 --- /dev/null +++ b/src/libsodium/crypto_stream/crypto_stream.c @@ -0,0 +1,18 @@ + +#include "crypto_stream.h" + +int +crypto_stream(unsigned char *c, unsigned long long clen, + const unsigned char *n, const unsigned char *k) +{ + return crypto_stream_xsalsa20(c, clen, n, k); +} + + +int +crypto_stream_xor(unsigned char *c, const unsigned char *m, + unsigned long long mlen, const unsigned char *n, + const unsigned char *k) +{ + return crypto_stream_xsalsa20_xor(c, m, mlen, n, k); +} diff --git a/src/libsodium/include/sodium/crypto_stream.h b/src/libsodium/include/sodium/crypto_stream.h index bfdd215b..6ef93de4 100644 --- a/src/libsodium/include/sodium/crypto_stream.h +++ b/src/libsodium/include/sodium/crypto_stream.h @@ -3,13 +3,16 @@ #include "crypto_stream_xsalsa20.h" -#define crypto_stream crypto_stream_xsalsa20 -#define crypto_stream_xor crypto_stream_xsalsa20_xor -#define crypto_stream_beforenm crypto_stream_xsalsa20_beforenm -#define crypto_stream_afternm crypto_stream_xsalsa20_afternm -#define crypto_stream_xor_afternm crypto_stream_xsalsa20_xor_afternm #define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES #define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES #define crypto_stream_PRIMITIVE "xsalsa20" +int crypto_stream(unsigned char *c, unsigned long long clen, + const unsigned char *n, const unsigned char *k); + + +int crypto_stream_xor(unsigned char *c, const unsigned char *m, + unsigned long long mlen, const unsigned char *n, + const unsigned char *k); + #endif