Skip to content

Commit

Permalink
Export stream_salsa20 constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Oct 22, 2013
1 parent e10a843 commit af28f8f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/libsodium/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
15 changes: 15 additions & 0 deletions src/libsodium/crypto_stream/salsa20/stream_salsa20_api.c
Original file line number Diff line number Diff line change
@@ -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";
}
15 changes: 12 additions & 3 deletions src/libsodium/include/sodium/crypto_stream_salsa20.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,24 @@
# endif
#endif

#include <stddef.h>
#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 *);

Expand Down

0 comments on commit af28f8f

Please sign in to comment.