From bac61ebf506c1b32185a3f3cc6a582445d55bc75 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 29 Jul 2017 17:58:18 +0200 Subject: [PATCH] BYTES_MAX -> MESSAGEBYTES_MAX --- .../crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c | 4 ++-- .../chacha20poly1305/sodium/aead_chacha20poly1305.c | 4 ++-- src/libsodium/crypto_box/crypto_box_easy.c | 4 ++-- .../box_curve25519xchacha20poly1305.c | 4 ++-- src/libsodium/crypto_secretbox/crypto_secretbox_easy.c | 2 +- .../xchacha20poly1305/secretbox_xchacha20poly1305.c | 2 +- src/libsodium/crypto_sign/ed25519/ref10/obsolete.c | 2 +- src/libsodium/crypto_sign/ed25519/ref10/open.c | 2 +- .../crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c | 2 +- .../crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c | 2 +- src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c | 2 +- src/libsodium/include/sodium/crypto_aead_aes256gcm.h | 2 +- src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h | 4 ++-- .../include/sodium/crypto_aead_xchacha20poly1305.h | 2 +- src/libsodium/include/sodium/crypto_box.h | 2 +- .../include/sodium/crypto_box_curve25519xchacha20poly1305.h | 4 ++-- .../include/sodium/crypto_box_curve25519xsalsa20poly1305.h | 4 ++-- src/libsodium/include/sodium/crypto_secretbox.h | 2 +- .../include/sodium/crypto_secretbox_xchacha20poly1305.h | 4 ++-- .../include/sodium/crypto_secretbox_xsalsa20poly1305.h | 4 ++-- src/libsodium/include/sodium/crypto_sign.h | 2 +- src/libsodium/include/sodium/crypto_sign_ed25519.h | 2 +- .../include/sodium/crypto_sign_edwards25519sha512batch.h | 2 +- src/libsodium/include/sodium/crypto_stream.h | 2 +- src/libsodium/include/sodium/crypto_stream_chacha20.h | 6 +++--- src/libsodium/include/sodium/crypto_stream_salsa20.h | 2 +- src/libsodium/include/sodium/crypto_stream_salsa2012.h | 2 +- src/libsodium/include/sodium/crypto_stream_salsa208.h | 2 +- src/libsodium/include/sodium/crypto_stream_xchacha20.h | 2 +- src/libsodium/include/sodium/crypto_stream_xsalsa20.h | 2 +- 30 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c b/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c index 99c6fe48..3b3003a5 100644 --- a/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +++ b/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c @@ -524,7 +524,7 @@ crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, (void) nsec; memcpy(H, ctx->H, sizeof H); - if (mlen > crypto_aead_aes256gcm_BYTES_MAX) { + if (mlen > crypto_aead_aes256gcm_MESSAGEBYTES_MAX) { sodium_misuse(); /* LCOV_EXCL_LINE */ } memcpy(&n2[0], npub, 3 * 4); @@ -662,7 +662,7 @@ crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m, unsigned char * CRYPTO_ALIGN(16) unsigned char fb[16]; (void) nsec; - if (clen > crypto_aead_aes256gcm_BYTES_MAX) { + if (clen > crypto_aead_aes256gcm_MESSAGEBYTES_MAX) { sodium_misuse(); /* LCOV_EXCL_LINE */ } mlen = clen; diff --git a/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c b/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c index b14f171c..e0fa3948 100644 --- a/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c +++ b/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c @@ -70,7 +70,7 @@ crypto_aead_chacha20poly1305_encrypt(unsigned char *c, unsigned long long clen = 0ULL; int ret; - if (mlen > crypto_aead_chacha20poly1305_BYTES_MAX) { + if (mlen > crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX) { sodium_misuse(); } ret = crypto_aead_chacha20poly1305_encrypt_detached(c, @@ -145,7 +145,7 @@ crypto_aead_chacha20poly1305_ietf_encrypt(unsigned char *c, unsigned long long clen = 0ULL; int ret; - if (mlen > crypto_aead_chacha20poly1305_ietf_BYTES_MAX) { + if (mlen > crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX) { sodium_misuse(); } ret = crypto_aead_chacha20poly1305_ietf_encrypt_detached(c, diff --git a/src/libsodium/crypto_box/crypto_box_easy.c b/src/libsodium/crypto_box/crypto_box_easy.c index 0aca0519..6cfd016b 100644 --- a/src/libsodium/crypto_box/crypto_box_easy.c +++ b/src/libsodium/crypto_box/crypto_box_easy.c @@ -40,7 +40,7 @@ crypto_box_easy_afternm(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *k) { - if (mlen > crypto_box_BYTES_MAX) { + if (mlen > crypto_box_MESSAGEBYTES_MAX) { return -1; } return crypto_box_detached_afternm(c + crypto_box_MACBYTES, c, m, mlen, n, @@ -52,7 +52,7 @@ crypto_box_easy(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) { - if (mlen > crypto_box_BYTES_MAX) { + if (mlen > crypto_box_MESSAGEBYTES_MAX) { return -1; } return crypto_box_detached(c + crypto_box_MACBYTES, c, m, mlen, n, diff --git a/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c b/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c index 142708bf..30650548 100644 --- a/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c +++ b/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c @@ -86,7 +86,7 @@ crypto_box_curve25519xchacha20poly1305_easy_afternm(unsigned char *c, const unsigned char *n, const unsigned char *k) { - if (mlen > crypto_box_curve25519xchacha20poly1305_BYTES_MAX) { + if (mlen > crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX) { return -1; } return crypto_box_curve25519xchacha20poly1305_detached_afternm( @@ -98,7 +98,7 @@ crypto_box_curve25519xchacha20poly1305_easy( unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) { - if (mlen > crypto_box_curve25519xchacha20poly1305_BYTES_MAX) { + if (mlen > crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX) { return -1; } return crypto_box_curve25519xchacha20poly1305_detached( diff --git a/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c b/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c index 2c7cbf95..cf47a763 100644 --- a/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +++ b/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c @@ -71,7 +71,7 @@ crypto_secretbox_easy(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *k) { - if (mlen > crypto_secretbox_BYTES_MAX) { + if (mlen > crypto_secretbox_MESSAGEBYTES_MAX) { return -1; } return crypto_secretbox_detached(c + crypto_secretbox_MACBYTES, diff --git a/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c b/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c index e85e9197..cd687dc8 100644 --- a/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c +++ b/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c @@ -77,7 +77,7 @@ crypto_secretbox_xchacha20poly1305_easy(unsigned char *c, const unsigned char *n, const unsigned char *k) { - if (mlen > crypto_secretbox_xchacha20poly1305_BYTES_MAX) { + if (mlen > crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX) { return -1; } return crypto_secretbox_xchacha20poly1305_detached diff --git a/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c b/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c index b074889e..5ff14884 100644 --- a/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +++ b/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c @@ -83,7 +83,7 @@ crypto_sign_edwards25519sha512batch_open(unsigned char *m, ge_p3 cs3; *mlen_p = 0; - if (smlen < 64 || smlen - 64 > crypto_sign_edwards25519sha512batch_BYTES_MAX) { + if (smlen < 64 || smlen - 64 > crypto_sign_edwards25519sha512batch_MESSAGEBYTES_MAX) { return -1; } mlen = smlen - 64; diff --git a/src/libsodium/crypto_sign/ed25519/ref10/open.c b/src/libsodium/crypto_sign/ed25519/ref10/open.c index ff1684ae..fa1c72d8 100644 --- a/src/libsodium/crypto_sign/ed25519/ref10/open.c +++ b/src/libsodium/crypto_sign/ed25519/ref10/open.c @@ -171,7 +171,7 @@ crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen_p, { unsigned long long mlen; - if (smlen < 64 || smlen - 64 > crypto_sign_ed25519_BYTES_MAX) { + if (smlen < 64 || smlen - 64 > crypto_sign_ed25519_MESSAGEBYTES_MAX) { goto badsig; } mlen = smlen - 64; diff --git a/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c b/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c index a472e3f1..6149af39 100644 --- a/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c +++ b/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c @@ -77,7 +77,7 @@ chacha20_encrypt_bytes(chacha_ctx *ctx, const uint8_t *m, uint8_t *c, if (!bytes) { return; /* LCOV_EXCL_LINE */ } - if (bytes > crypto_stream_chacha20_BYTES_MAX) { + if (bytes > crypto_stream_chacha20_MESSAGEBYTES_MAX) { sodium_misuse(); } # include "u8.h" diff --git a/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c b/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c index 55629c34..b7b9aa4a 100644 --- a/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c +++ b/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c @@ -72,7 +72,7 @@ chacha20_encrypt_bytes(chacha_ctx *ctx, const uint8_t *m, uint8_t *c, if (!bytes) { return; /* LCOV_EXCL_LINE */ } - if (bytes > crypto_stream_chacha20_BYTES_MAX) { + if (bytes > crypto_stream_chacha20_MESSAGEBYTES_MAX) { sodium_misuse(); } # include "u4.h" diff --git a/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c b/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c index 297d299c..f88a99db 100644 --- a/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c +++ b/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c @@ -92,7 +92,7 @@ chacha20_encrypt_bytes(chacha_ctx *ctx, const uint8_t *m, uint8_t *c, if (!bytes) { return; /* LCOV_EXCL_LINE */ } - if (bytes > crypto_stream_chacha20_BYTES_MAX) { + if (bytes > crypto_stream_chacha20_MESSAGEBYTES_MAX) { sodium_misuse(); } j0 = ctx->input[0]; diff --git a/src/libsodium/include/sodium/crypto_aead_aes256gcm.h b/src/libsodium/include/sodium/crypto_aead_aes256gcm.h index a6f12aaa..31ca77b7 100644 --- a/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +++ b/src/libsodium/include/sodium/crypto_aead_aes256gcm.h @@ -30,7 +30,7 @@ size_t crypto_aead_aes256gcm_npubbytes(void); SODIUM_EXPORT size_t crypto_aead_aes256gcm_abytes(void); -#define crypto_aead_aes256gcm_BYTES_MAX \ +#define crypto_aead_aes256gcm_MESSAGEBYTES_MAX \ SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_aes256gcm_ABYTES, \ (16ULL * ((1ULL << 32) - 2ULL)) - crypto_aead_aes256gcm_ABYTES) diff --git a/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h b/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h index 1617a138..cceb1062 100644 --- a/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h @@ -30,7 +30,7 @@ size_t crypto_aead_chacha20poly1305_ietf_npubbytes(void); SODIUM_EXPORT size_t crypto_aead_chacha20poly1305_ietf_abytes(void); -#define crypto_aead_chacha20poly1305_ietf_BYTES_MAX \ +#define crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX \ SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_chacha20poly1305_ietf_ABYTES, \ (64ULL * (1ULL << 32) - 64ULL) - crypto_aead_chacha20poly1305_ietf_ABYTES) @@ -102,7 +102,7 @@ size_t crypto_aead_chacha20poly1305_npubbytes(void); SODIUM_EXPORT size_t crypto_aead_chacha20poly1305_abytes(void); -#define crypto_aead_chacha20poly1305_BYTES_MAX \ +#define crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX \ (SODIUM_SIZE_MAX - crypto_aead_chacha20poly1305_ABYTES) SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h index 8c1224d5..b5b9d317 100644 --- a/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h @@ -27,7 +27,7 @@ size_t crypto_aead_xchacha20poly1305_ietf_npubbytes(void); SODIUM_EXPORT size_t crypto_aead_xchacha20poly1305_ietf_abytes(void); -#define crypto_aead_xchacha20poly1305_ietf_BYTES_MAX \ +#define crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX \ (SODIUM_SIZE_MAX - crypto_aead_xchacha20poly1305_ietf_ABYTES) SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_box.h b/src/libsodium/include/sodium/crypto_box.h index 1adf377b..eb0def73 100644 --- a/src/libsodium/include/sodium/crypto_box.h +++ b/src/libsodium/include/sodium/crypto_box.h @@ -40,7 +40,7 @@ size_t crypto_box_noncebytes(void); SODIUM_EXPORT size_t crypto_box_macbytes(void); -#define crypto_box_BYTES_MAX crypto_box_curve25519xsalsa20poly1305_BYTES_MAX +#define crypto_box_MESSAGEBYTES_MAX crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX #define crypto_box_PRIMITIVE "curve25519xsalsa20poly1305" SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h index 6fd8e987..9b299a0b 100644 --- a/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h @@ -37,8 +37,8 @@ size_t crypto_box_curve25519xchacha20poly1305_noncebytes(void); SODIUM_EXPORT size_t crypto_box_curve25519xchacha20poly1305_macbytes(void); -#define crypto_box_curve25519xchacha20poly1305_BYTES_MAX \ - (crypto_stream_xchacha20_BYTES_MAX - crypto_box_curve25519xchacha20poly1305_MACBYTES) +#define crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX \ + (crypto_stream_xchacha20_MESSAGEBYTES_MAX - crypto_box_curve25519xchacha20poly1305_MACBYTES) SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_seed_keypair(unsigned char *pk, diff --git a/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h index e9491a82..4a0e1455 100644 --- a/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +++ b/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h @@ -48,8 +48,8 @@ size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void); SODIUM_EXPORT size_t crypto_box_curve25519xsalsa20poly1305_zerobytes(void); -#define crypto_box_curve25519xsalsa20poly1305_BYTES_MAX \ - (crypto_stream_xsalsa20_BYTES_MAX - crypto_box_curve25519xsalsa20poly1305_ZEROBYTES) +#define crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX \ + (crypto_stream_xsalsa20_MESSAGEBYTES_MAX - crypto_box_curve25519xsalsa20poly1305_ZEROBYTES) SODIUM_EXPORT int crypto_box_curve25519xsalsa20poly1305(unsigned char *c, diff --git a/src/libsodium/include/sodium/crypto_secretbox.h b/src/libsodium/include/sodium/crypto_secretbox.h index 420a294f..7a28a4e2 100644 --- a/src/libsodium/include/sodium/crypto_secretbox.h +++ b/src/libsodium/include/sodium/crypto_secretbox.h @@ -29,7 +29,7 @@ size_t crypto_secretbox_macbytes(void); SODIUM_EXPORT const char *crypto_secretbox_primitive(void); -#define crypto_secretbox_BYTES_MAX crypto_secretbox_xsalsa20poly1305_BYTES_MAX +#define crypto_secretbox_MESSAGEBYTES_MAX crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX SODIUM_EXPORT int crypto_secretbox_easy(unsigned char *c, const unsigned char *m, diff --git a/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h index b8701197..0858ea3e 100644 --- a/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h @@ -24,8 +24,8 @@ size_t crypto_secretbox_xchacha20poly1305_noncebytes(void); SODIUM_EXPORT size_t crypto_secretbox_xchacha20poly1305_macbytes(void); -#define crypto_secretbox_xchacha20poly1305_BYTES_MAX \ - (crypto_stream_xchacha20_BYTES_MAX - crypto_secretbox_xchacha20poly1305_MACBYTES) +#define crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX \ + (crypto_stream_xchacha20_MESSAGEBYTES_MAX - crypto_secretbox_xchacha20poly1305_MACBYTES) SODIUM_EXPORT int crypto_secretbox_xchacha20poly1305_easy(unsigned char *c, diff --git a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h index 36e4c114..04006a03 100644 --- a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +++ b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h @@ -24,8 +24,8 @@ size_t crypto_secretbox_xsalsa20poly1305_noncebytes(void); SODIUM_EXPORT size_t crypto_secretbox_xsalsa20poly1305_macbytes(void); -#define crypto_secretbox_xsalsa20poly1305_BYTES_MAX \ - (crypto_stream_xsalsa20_BYTES_MAX - crypto_secretbox_xsalsa20poly1305_ZEROBYTES) +#define crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX \ + (crypto_stream_xsalsa20_MESSAGEBYTES_MAX - crypto_secretbox_xsalsa20poly1305_ZEROBYTES) SODIUM_EXPORT int crypto_secretbox_xsalsa20poly1305(unsigned char *c, diff --git a/src/libsodium/include/sodium/crypto_sign.h b/src/libsodium/include/sodium/crypto_sign.h index 64e95f99..e1cc8a12 100644 --- a/src/libsodium/include/sodium/crypto_sign.h +++ b/src/libsodium/include/sodium/crypto_sign.h @@ -41,7 +41,7 @@ size_t crypto_sign_publickeybytes(void); SODIUM_EXPORT size_t crypto_sign_secretkeybytes(void); -#define crypto_sign_BYTES_MAX crypto_sign_ed25519_BYTES_MAX +#define crypto_sign_MESSAGEBYTES_MAX crypto_sign_ed25519_MESSAGEBYTES_MAX #define crypto_sign_PRIMITIVE "ed25519" SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_sign_ed25519.h b/src/libsodium/include/sodium/crypto_sign_ed25519.h index c6905c20..95f0cbc4 100644 --- a/src/libsodium/include/sodium/crypto_sign_ed25519.h +++ b/src/libsodium/include/sodium/crypto_sign_ed25519.h @@ -35,7 +35,7 @@ size_t crypto_sign_ed25519_publickeybytes(void); SODIUM_EXPORT size_t crypto_sign_ed25519_secretkeybytes(void); -#define crypto_sign_ed25519_BYTES_MAX (SODIUM_SIZE_MAX - crypto_sign_ed25519_BYTES) +#define crypto_sign_ed25519_MESSAGEBYTES_MAX (SODIUM_SIZE_MAX - crypto_sign_ed25519_BYTES) SODIUM_EXPORT int crypto_sign_ed25519(unsigned char *sm, unsigned long long *smlen_p, diff --git a/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h b/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h index 50b51843..4bb91924 100644 --- a/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +++ b/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h @@ -25,7 +25,7 @@ extern "C" { #define crypto_sign_edwards25519sha512batch_BYTES 64U #define crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES 32U #define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES (32U + 32U) -#define crypto_sign_edwards25519sha512batch_BYTES_MAX (SODIUM_SIZE_MAX - crypto_sign_edwards25519sha512batch_BYTES) +#define crypto_sign_edwards25519sha512batch_MESSAGEBYTES_MAX (SODIUM_SIZE_MAX - crypto_sign_edwards25519sha512batch_BYTES) SODIUM_EXPORT int crypto_sign_edwards25519sha512batch(unsigned char *sm, diff --git a/src/libsodium/include/sodium/crypto_stream.h b/src/libsodium/include/sodium/crypto_stream.h index da3e165d..52ab20a9 100644 --- a/src/libsodium/include/sodium/crypto_stream.h +++ b/src/libsodium/include/sodium/crypto_stream.h @@ -29,7 +29,7 @@ size_t crypto_stream_keybytes(void); SODIUM_EXPORT size_t crypto_stream_noncebytes(void); -#define crypto_stream_BYTES_MAX crypto_stream_xsalsa20_BYTES_MAX +#define crypto_stream_MESSAGEBYTES_MAX crypto_stream_xsalsa20_MESSAGEBYTES_MAX #define crypto_stream_PRIMITIVE "xsalsa20" SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_stream_chacha20.h b/src/libsodium/include/sodium/crypto_stream_chacha20.h index d52e1812..d4e76b79 100644 --- a/src/libsodium/include/sodium/crypto_stream_chacha20.h +++ b/src/libsodium/include/sodium/crypto_stream_chacha20.h @@ -28,7 +28,7 @@ size_t crypto_stream_chacha20_keybytes(void); SODIUM_EXPORT size_t crypto_stream_chacha20_noncebytes(void); -#define crypto_stream_chacha20_BYTES_MAX SODIUM_SIZE_MAX +#define crypto_stream_chacha20_MESSAGEBYTES_MAX SODIUM_SIZE_MAX /* ChaCha20 with a 64-bit nonce and a 64-bit counter, as originally designed */ @@ -60,7 +60,7 @@ size_t crypto_stream_chacha20_ietf_keybytes(void); SODIUM_EXPORT size_t crypto_stream_chacha20_ietf_noncebytes(void); -#define crypto_stream_chacha20_ietf_BYTES_MAX \ +#define crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX \ SODIUM_MIN(SODIUM_SIZE_MAX, 64ULL * (1ULL << 32)) SODIUM_EXPORT @@ -85,7 +85,7 @@ void crypto_stream_chacha20_ietf_keygen(unsigned char k[crypto_stream_chacha20_i #define crypto_stream_chacha20_IETF_KEYBYTES crypto_stream_chacha20_ietf_KEYBYTES #define crypto_stream_chacha20_IETF_NONCEBYTES crypto_stream_chacha20_ietf_NONCEBYTES -#define crypto_stream_chacha20_IETF_BYTES_MAX crypto_stream_chacha20_ietf_BYTES_MAX +#define crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_stream_salsa20.h b/src/libsodium/include/sodium/crypto_stream_salsa20.h index 4bbc9251..011b830a 100644 --- a/src/libsodium/include/sodium/crypto_stream_salsa20.h +++ b/src/libsodium/include/sodium/crypto_stream_salsa20.h @@ -28,7 +28,7 @@ size_t crypto_stream_salsa20_keybytes(void); SODIUM_EXPORT size_t crypto_stream_salsa20_noncebytes(void); -#define crypto_stream_salsa20_BYTES_MAX SODIUM_SIZE_MAX +#define crypto_stream_salsa20_MESSAGEBYTES_MAX SODIUM_SIZE_MAX SODIUM_EXPORT int crypto_stream_salsa20(unsigned char *c, unsigned long long clen, diff --git a/src/libsodium/include/sodium/crypto_stream_salsa2012.h b/src/libsodium/include/sodium/crypto_stream_salsa2012.h index 9a2fc2e4..cd34501a 100644 --- a/src/libsodium/include/sodium/crypto_stream_salsa2012.h +++ b/src/libsodium/include/sodium/crypto_stream_salsa2012.h @@ -27,7 +27,7 @@ size_t crypto_stream_salsa2012_keybytes(void); SODIUM_EXPORT size_t crypto_stream_salsa2012_noncebytes(void); -#define crypto_stream_salsa2012_BYTES_MAX SODIUM_SIZE_MAX +#define crypto_stream_salsa2012_MESSAGEBYTES_MAX SODIUM_SIZE_MAX SODIUM_EXPORT int crypto_stream_salsa2012(unsigned char *c, unsigned long long clen, diff --git a/src/libsodium/include/sodium/crypto_stream_salsa208.h b/src/libsodium/include/sodium/crypto_stream_salsa208.h index 81b58d6f..ec3f1bee 100644 --- a/src/libsodium/include/sodium/crypto_stream_salsa208.h +++ b/src/libsodium/include/sodium/crypto_stream_salsa208.h @@ -27,7 +27,7 @@ size_t crypto_stream_salsa208_keybytes(void); SODIUM_EXPORT size_t crypto_stream_salsa208_noncebytes(void); -#define crypto_stream_salsa208_BYTES_MAX SODIUM_SIZE_MAX +#define crypto_stream_salsa208_MESSAGEBYTES_MAX SODIUM_SIZE_MAX SODIUM_EXPORT int crypto_stream_salsa208(unsigned char *c, unsigned long long clen, diff --git a/src/libsodium/include/sodium/crypto_stream_xchacha20.h b/src/libsodium/include/sodium/crypto_stream_xchacha20.h index a37d4943..bcce05cd 100644 --- a/src/libsodium/include/sodium/crypto_stream_xchacha20.h +++ b/src/libsodium/include/sodium/crypto_stream_xchacha20.h @@ -28,7 +28,7 @@ size_t crypto_stream_xchacha20_keybytes(void); SODIUM_EXPORT size_t crypto_stream_xchacha20_noncebytes(void); -#define crypto_stream_xchacha20_BYTES_MAX SODIUM_SIZE_MAX +#define crypto_stream_xchacha20_MESSAGEBYTES_MAX SODIUM_SIZE_MAX SODIUM_EXPORT int crypto_stream_xchacha20(unsigned char *c, unsigned long long clen, diff --git a/src/libsodium/include/sodium/crypto_stream_xsalsa20.h b/src/libsodium/include/sodium/crypto_stream_xsalsa20.h index 196e6c96..3912fe3d 100644 --- a/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +++ b/src/libsodium/include/sodium/crypto_stream_xsalsa20.h @@ -28,7 +28,7 @@ size_t crypto_stream_xsalsa20_keybytes(void); SODIUM_EXPORT size_t crypto_stream_xsalsa20_noncebytes(void); -#define crypto_stream_xsalsa20_BYTES_MAX SODIUM_SIZE_MAX +#define crypto_stream_xsalsa20_MESSAGEBYTES_MAX SODIUM_SIZE_MAX SODIUM_EXPORT int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen,