Add aliases for stream_chacha20 sizes, similar to chacha20poly1305

This commit is contained in:
Frank Denis 2017-02-19 18:54:25 +01:00
parent cafb0a695b
commit 4c6b0ac762
2 changed files with 16 additions and 2 deletions

View File

@ -19,9 +19,14 @@ crypto_stream_chacha20_noncebytes(void) {
return crypto_stream_chacha20_NONCEBYTES;
}
size_t
crypto_stream_chacha20_ietf_keybytes(void) {
return crypto_stream_chacha20_ietf_KEYBYTES;
}
size_t
crypto_stream_chacha20_ietf_noncebytes(void) {
return crypto_stream_chacha20_IETF_NONCEBYTES;
return crypto_stream_chacha20_ietf_NONCEBYTES;
}
int

View File

@ -47,7 +47,11 @@ int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
/* ChaCha20 with a 96-bit nonce and a 32-bit counter (IETF) */
#define crypto_stream_chacha20_IETF_NONCEBYTES 12U
#define crypto_stream_chacha20_ietf_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_stream_chacha20_ietf_keybytes(void);
#define crypto_stream_chacha20_ietf_NONCEBYTES 12U
SODIUM_EXPORT
size_t crypto_stream_chacha20_ietf_noncebytes(void);
@ -70,6 +74,11 @@ int crypto_stream_chacha20_ietf_xor_ic(unsigned char *c, const unsigned char *m,
int _crypto_stream_chacha20_pick_best_implementation(void);
/* Aliases */
#define crypto_stream_chacha20_IETF_KEYBYTES crypto_stream_chacha20_ietf_KEYBYTES
#define crypto_stream_chacha20_IETF_NONCEBYTES crypto_stream_chacha20_ietf_NONCEBYTES
#ifdef __cplusplus
}
#endif