From f8e535a44663140cfadf6580d6605df6fc193f8f Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 25 Aug 2017 15:12:35 +0200 Subject: [PATCH] messagesbytes -> messagebytes --- dist-build/emscripten-symbols.def | 9 +++++++++ .../xchacha20poly1305/secretstream_xchacha20poly1305.c | 8 ++++---- .../sodium/crypto_secretstream_xchacha20poly1305.h | 4 ++-- test/default/secretstream.c | 4 ++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/dist-build/emscripten-symbols.def b/dist-build/emscripten-symbols.def index c9d0ca76..c384f011 100644 --- a/dist-build/emscripten-symbols.def +++ b/dist-build/emscripten-symbols.def @@ -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 diff --git a/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c b/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c index ff915362..2a6245e3 100644 --- a/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c +++ b/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c @@ -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 diff --git a/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h index 5d446efa..571b0009 100644 --- a/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h @@ -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 diff --git a/test/default/secretstream.c b/test/default/secretstream.c index 3492ca27..2f1f0b3b 100644 --- a/test/default/secretstream.c +++ b/test/default/secretstream.c @@ -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);