diff --git a/ChangeLog b/ChangeLog index a688334f..c862b914 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,7 @@ - big-endian architectures are now supported as well - The donna_c64 implementation of curve25519_donna_c64 now handles non-canonical points like the ref implementation - - Missing scalarmult_curve25519 constants are now exported + - Missing scalarmult_curve25519 and stream_salsa20 constants are now exported - A crypto_onetimeauth_poly1305_ref() wrapper has been added * Version 0.4.3 diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index f34306c7..b108f6e6 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -159,6 +159,7 @@ libsodium_la_SOURCES = \ crypto_stream/aes256estream/stream_aes256estream_api.c \ crypto_stream/aes256estream/hongjun/api.h \ crypto_stream/aes256estream/hongjun/ecrypt-sync.h \ + crypto_stream/salsa20/stream_salsa20_api.c \ crypto_stream/salsa2012/stream_salsa2012_api.c \ crypto_stream/salsa2012/ref/api.h \ crypto_stream/salsa2012/ref/stream_salsa2012.c \ diff --git a/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c b/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c index 037fb59d..fce456e4 100644 --- a/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c +++ b/src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c @@ -1 +1,16 @@ #include "crypto_stream_salsa20.h" + +size_t +crypto_stream_salsa20_keybytes(void) { + return crypto_stream_salsa20_KEYBYTES; +} + +size_t +crypto_stream_salsa20_noncebytes(void) { + return crypto_stream_salsa20_NONCEBYTES; +} + +const char * +crypto_stream_salsa20_primitive(void) { + return "salsa20"; +} diff --git a/src/libsodium/include/sodium/crypto_stream_salsa20.h.in b/src/libsodium/include/sodium/crypto_stream_salsa20.h.in index 9f8e9df2..b55e0ef3 100644 --- a/src/libsodium/include/sodium/crypto_stream_salsa20.h.in +++ b/src/libsodium/include/sodium/crypto_stream_salsa20.h.in @@ -15,15 +15,24 @@ # endif #endif +#include #include "export.h" -#define crypto_stream_salsa20_KEYBYTES 32U -#define crypto_stream_salsa20_NONCEBYTES 8U - #ifdef __cplusplus extern "C" { #endif +#define crypto_stream_salsa20_KEYBYTES 32U +SODIUM_EXPORT +size_t crypto_stream_salsa20_keybytes(void); + +#define crypto_stream_salsa20_NONCEBYTES 8U +SODIUM_EXPORT +size_t crypto_stream_salsa20_noncebytes(void); + +SODIUM_EXPORT +const char * crypto_stream_salsa20_primitive(void); + SODIUM_EXPORT int crypto_stream_salsa20(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);