messagesbytes -> messagebytes

This commit is contained in:
Frank Denis 2017-08-25 15:12:35 +02:00
parent cd721cfc1f
commit f8e535a446
4 changed files with 17 additions and 8 deletions

View File

@ -378,13 +378,21 @@ _crypto_secretbox_xsalsa20poly1305_noncebytes 0 1
_crypto_secretbox_xsalsa20poly1305_open 0 1
_crypto_secretbox_xsalsa20poly1305_zerobytes 0 1
_crypto_secretbox_zerobytes 0 1
_crypto_secretstream_xchacha20poly1305_abytes 1 1
_crypto_secretstream_xchacha20poly1305_init_pull 1 1
_crypto_secretstream_xchacha20poly1305_init_push 1 1
_crypto_secretstream_xchacha20poly1305_initbytes 1 1
_crypto_secretstream_xchacha20poly1305_keybytes 1 1
_crypto_secretstream_xchacha20poly1305_keygen 1 1
_crypto_secretstream_xchacha20poly1305_messagebytes_max 1 1
_crypto_secretstream_xchacha20poly1305_pull 1 1
_crypto_secretstream_xchacha20poly1305_push 1 1
_crypto_secretstream_xchacha20poly1305_rekey 1 1
_crypto_secretstream_xchacha20poly1305_statebytes 1 1
_crypto_secretstream_xchacha20poly1305_tag_final 1 1
_crypto_secretstream_xchacha20poly1305_tag_message 1 1
_crypto_secretstream_xchacha20poly1305_tag_push 1 1
_crypto_secretstream_xchacha20poly1305_tag_rekey 1 1
_crypto_shorthash 1 1
_crypto_shorthash_bytes 1 1
_crypto_shorthash_keybytes 1 1
@ -474,6 +482,7 @@ _crypto_stream_salsa2012_xor 0 1
_crypto_stream_salsa208 0 1
_crypto_stream_salsa208_keybytes 0 1
_crypto_stream_salsa208_keygen 0 1
_crypto_stream_salsa208_messagebytes_max 0 1
_crypto_stream_salsa208_noncebytes 0 1
_crypto_stream_salsa208_xor 0 1
_crypto_stream_salsa20_keybytes 0 1

View File

@ -96,7 +96,7 @@ crypto_secretstream_xchacha20poly1305_push
if (outlen_p != NULL) {
*outlen_p = 0U;
}
if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX) {
if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) {
sodium_misuse();
}
crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k);
@ -172,7 +172,7 @@ crypto_secretstream_xchacha20poly1305_pull
return -1;
}
mlen = inlen - crypto_secretstream_xchacha20poly1305_ABYTES;
if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX) {
if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) {
sodium_misuse();
}
crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k);
@ -257,9 +257,9 @@ crypto_secretstream_xchacha20poly1305_keybytes(void)
}
size_t
crypto_secretstream_xchacha20poly1305_messagesbytes_max(void)
crypto_secretstream_xchacha20poly1305_messagebytes_max(void)
{
return crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX;
return crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX;
}
unsigned char

View File

@ -29,10 +29,10 @@ size_t crypto_secretstream_xchacha20poly1305_initbytes(void);
SODIUM_EXPORT
size_t crypto_secretstream_xchacha20poly1305_keybytes(void);
#define crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX \
#define crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX \
((1ULL << 32) - 2ULL * 64ULL)
SODIUM_EXPORT
size_t crypto_secretstream_xchacha20poly1305_messagesbytes_max(void);
size_t crypto_secretstream_xchacha20poly1305_messagebytes_max(void);
#define crypto_secretstream_xchacha20poly1305_TAG_MESSAGE 0x00
SODIUM_EXPORT

View File

@ -181,8 +181,8 @@ main(void)
crypto_secretstream_xchacha20poly1305_INITBYTES);
assert(crypto_secretstream_xchacha20poly1305_keybytes() ==
crypto_secretstream_xchacha20poly1305_KEYBYTES);
assert(crypto_secretstream_xchacha20poly1305_messagesbytes_max() ==
crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX);
assert(crypto_secretstream_xchacha20poly1305_messagebytes_max() ==
crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX);
assert(crypto_secretstream_xchacha20poly1305_tag_message() ==
crypto_secretstream_xchacha20poly1305_TAG_MESSAGE);