diff --git a/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c b/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c index 249f28f0..cc7ad1b1 100644 --- a/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c +++ b/src/libsodium/crypto_generichash/blake2/generichash_blake2_api.c @@ -10,6 +10,11 @@ crypto_generichash_blake2b_bytes_max(void) { return crypto_generichash_blake2b_BYTES_MAX; } +size_t +crypto_generichash_blake2b_bytes(void) { + return crypto_generichash_blake2b_BYTES; +} + size_t crypto_generichash_blake2b_keybytes_min(void) { return crypto_generichash_blake2b_KEYBYTES_MIN; @@ -21,8 +26,8 @@ crypto_generichash_blake2b_keybytes_max(void) { } size_t -crypto_generichash_blake2b_blockbytes(void) { - return crypto_generichash_blake2b_BLOCKBYTES; +crypto_generichash_blake2b_keybytes(void) { + return crypto_generichash_blake2b_KEYBYTES; } size_t diff --git a/src/libsodium/crypto_generichash/crypto_generichash.c b/src/libsodium/crypto_generichash/crypto_generichash.c index e418a94a..e7cc0ae6 100644 --- a/src/libsodium/crypto_generichash/crypto_generichash.c +++ b/src/libsodium/crypto_generichash/crypto_generichash.c @@ -1,12 +1,6 @@ #include "crypto_generichash.h" -size_t -crypto_generichash_bytes(void) -{ - return crypto_generichash_BYTES; -} - size_t crypto_generichash_bytes_min(void) { @@ -20,9 +14,9 @@ crypto_generichash_bytes_max(void) } size_t -crypto_generichash_keybytes(void) +crypto_generichash_bytes(void) { - return crypto_generichash_KEYBYTES; + return crypto_generichash_BYTES; } size_t @@ -38,9 +32,9 @@ crypto_generichash_keybytes_max(void) } size_t -crypto_generichash_blockbytes(void) +crypto_generichash_keybytes(void) { - return crypto_generichash_BLOCKBYTES; + return crypto_generichash_KEYBYTES; } const char *crypto_generichash_primitive(void) diff --git a/src/libsodium/crypto_hash/crypto_hash.c b/src/libsodium/crypto_hash/crypto_hash.c index e05223d4..037fa152 100644 --- a/src/libsodium/crypto_hash/crypto_hash.c +++ b/src/libsodium/crypto_hash/crypto_hash.c @@ -1,6 +1,12 @@ #include "crypto_hash.h" +size_t +crypto_hash_bytes(void) +{ + return crypto_hash_BYTES; +} + int crypto_hash(unsigned char *out, const unsigned char *in, unsigned long long inlen) diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha256.h b/src/libsodium/include/sodium/crypto_auth_hmacsha256.h index be80a077..8ea5057d 100644 --- a/src/libsodium/include/sodium/crypto_auth_hmacsha256.h +++ b/src/libsodium/include/sodium/crypto_auth_hmacsha256.h @@ -5,9 +5,6 @@ #include "crypto_hash_sha256.h" #include "export.h" -#define crypto_auth_hmacsha256_BYTES 32U -#define crypto_auth_hmacsha256_KEYBYTES 32U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -20,9 +17,11 @@ typedef struct crypto_auth_hmacsha256_state { crypto_hash_sha256_state octx; } crypto_auth_hmacsha256_state; +#define crypto_auth_hmacsha256_BYTES 32U SODIUM_EXPORT size_t crypto_auth_hmacsha256_bytes(void); +#define crypto_auth_hmacsha256_KEYBYTES 32U SODIUM_EXPORT size_t crypto_auth_hmacsha256_keybytes(void); diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha512.h b/src/libsodium/include/sodium/crypto_auth_hmacsha512.h index 0d03f40c..be162069 100644 --- a/src/libsodium/include/sodium/crypto_auth_hmacsha512.h +++ b/src/libsodium/include/sodium/crypto_auth_hmacsha512.h @@ -5,9 +5,6 @@ #include "crypto_hash_sha512.h" #include "export.h" -#define crypto_auth_hmacsha512_BYTES 64U -#define crypto_auth_hmacsha512_KEYBYTES 32U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -20,9 +17,11 @@ typedef struct crypto_auth_hmacsha512_state { crypto_hash_sha512_state octx; } crypto_auth_hmacsha512_state; +#define crypto_auth_hmacsha512_BYTES 64U SODIUM_EXPORT size_t crypto_auth_hmacsha512_bytes(void); +#define crypto_auth_hmacsha512_KEYBYTES 32U SODIUM_EXPORT size_t crypto_auth_hmacsha512_keybytes(void); @@ -54,7 +53,7 @@ int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state, SODIUM_EXPORT int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state, unsigned char *out); - + #ifdef __cplusplus } #endif diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h b/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h index ed6471ce..3ee1a046 100644 --- a/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h +++ b/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h @@ -5,9 +5,6 @@ #include "crypto_auth_hmacsha512.h" #include "export.h" -#define crypto_auth_hmacsha512256_BYTES 32U -#define crypto_auth_hmacsha512256_KEYBYTES 32U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -17,9 +14,11 @@ extern "C" { typedef struct crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state; +#define crypto_auth_hmacsha512256_BYTES 32U SODIUM_EXPORT size_t crypto_auth_hmacsha512256_bytes(void); +#define crypto_auth_hmacsha512256_KEYBYTES 32U SODIUM_EXPORT size_t crypto_auth_hmacsha512256_keybytes(void); diff --git a/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h index 8ea06562..c40905ce 100644 --- a/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +++ b/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h @@ -4,14 +4,6 @@ #include #include "export.h" -#define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 32U -#define crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES 32U -#define crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES 32U -#define crypto_box_curve25519xsalsa20poly1305_NONCEBYTES 24U -#define crypto_box_curve25519xsalsa20poly1305_ZEROBYTES 32U -#define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 16U -#define crypto_box_curve25519xsalsa20poly1305_MACBYTES (crypto_box_curve25519xsalsa20poly1305_ZEROBYTES - crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES) - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -19,24 +11,33 @@ extern "C" { #endif +#define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 32U SODIUM_EXPORT size_t crypto_box_curve25519xsalsa20poly1305_publickeybytes(void); +#define crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES 32U SODIUM_EXPORT size_t crypto_box_curve25519xsalsa20poly1305_secretkeybytes(void); +#define crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES 32U SODIUM_EXPORT size_t crypto_box_curve25519xsalsa20poly1305_beforenmbytes(void); +#define crypto_box_curve25519xsalsa20poly1305_NONCEBYTES 24U SODIUM_EXPORT size_t crypto_box_curve25519xsalsa20poly1305_noncebytes(void); +#define crypto_box_curve25519xsalsa20poly1305_ZEROBYTES 32U SODIUM_EXPORT size_t crypto_box_curve25519xsalsa20poly1305_zerobytes(void); +#define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 16U SODIUM_EXPORT size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void); +#define crypto_box_curve25519xsalsa20poly1305_MACBYTES \ + (crypto_box_curve25519xsalsa20poly1305_ZEROBYTES - \ + crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES) SODIUM_EXPORT size_t crypto_box_curve25519xsalsa20poly1305_macbytes(void); diff --git a/src/libsodium/include/sodium/crypto_core_hsalsa20.h b/src/libsodium/include/sodium/crypto_core_hsalsa20.h index 73a60ae6..2b85994d 100644 --- a/src/libsodium/include/sodium/crypto_core_hsalsa20.h +++ b/src/libsodium/include/sodium/crypto_core_hsalsa20.h @@ -4,24 +4,23 @@ #include #include "export.h" -#define crypto_core_hsalsa20_OUTPUTBYTES 32U -#define crypto_core_hsalsa20_INPUTBYTES 16U -#define crypto_core_hsalsa20_KEYBYTES 32U -#define crypto_core_hsalsa20_CONSTBYTES 16U - #ifdef __cplusplus extern "C" { #endif +#define crypto_core_hsalsa20_OUTPUTBYTES 32U SODIUM_EXPORT size_t crypto_core_hsalsa20_outputbytes(void); +#define crypto_core_hsalsa20_INPUTBYTES 16U SODIUM_EXPORT size_t crypto_core_hsalsa20_inputbytes(void); +#define crypto_core_hsalsa20_KEYBYTES 32U SODIUM_EXPORT size_t crypto_core_hsalsa20_keybytes(void); +#define crypto_core_hsalsa20_CONSTBYTES 16U SODIUM_EXPORT size_t crypto_core_hsalsa20_constbytes(void); diff --git a/src/libsodium/include/sodium/crypto_core_salsa20.h b/src/libsodium/include/sodium/crypto_core_salsa20.h index 8ab7e8c5..8a4518bd 100644 --- a/src/libsodium/include/sodium/crypto_core_salsa20.h +++ b/src/libsodium/include/sodium/crypto_core_salsa20.h @@ -4,24 +4,23 @@ #include #include "export.h" -#define crypto_core_salsa20_OUTPUTBYTES 64U -#define crypto_core_salsa20_INPUTBYTES 16U -#define crypto_core_salsa20_KEYBYTES 32U -#define crypto_core_salsa20_CONSTBYTES 16U - #ifdef __cplusplus extern "C" { #endif +#define crypto_core_salsa20_OUTPUTBYTES 64U SODIUM_EXPORT size_t crypto_core_salsa20_outputbytes(void); +#define crypto_core_salsa20_INPUTBYTES 16U SODIUM_EXPORT size_t crypto_core_salsa20_inputbytes(void); +#define crypto_core_salsa20_KEYBYTES 32U SODIUM_EXPORT size_t crypto_core_salsa20_keybytes(void); +#define crypto_core_salsa20_CONSTBYTES 16U SODIUM_EXPORT size_t crypto_core_salsa20_constbytes(void); diff --git a/src/libsodium/include/sodium/crypto_core_salsa2012.h b/src/libsodium/include/sodium/crypto_core_salsa2012.h index cf7dd2fa..69a45ca8 100644 --- a/src/libsodium/include/sodium/crypto_core_salsa2012.h +++ b/src/libsodium/include/sodium/crypto_core_salsa2012.h @@ -4,24 +4,23 @@ #include #include "export.h" -#define crypto_core_salsa2012_OUTPUTBYTES 64U -#define crypto_core_salsa2012_INPUTBYTES 16U -#define crypto_core_salsa2012_KEYBYTES 32U -#define crypto_core_salsa2012_CONSTBYTES 16U - #ifdef __cplusplus extern "C" { #endif +#define crypto_core_salsa2012_OUTPUTBYTES 64U SODIUM_EXPORT size_t crypto_core_salsa2012_outputbytes(void); +#define crypto_core_salsa2012_INPUTBYTES 16U SODIUM_EXPORT size_t crypto_core_salsa2012_inputbytes(void); +#define crypto_core_salsa2012_KEYBYTES 32U SODIUM_EXPORT size_t crypto_core_salsa2012_keybytes(void); +#define crypto_core_salsa2012_CONSTBYTES 16U SODIUM_EXPORT size_t crypto_core_salsa2012_constbytes(void); diff --git a/src/libsodium/include/sodium/crypto_core_salsa208.h b/src/libsodium/include/sodium/crypto_core_salsa208.h index d85fdbde..4f0b8e15 100644 --- a/src/libsodium/include/sodium/crypto_core_salsa208.h +++ b/src/libsodium/include/sodium/crypto_core_salsa208.h @@ -4,24 +4,23 @@ #include #include "export.h" -#define crypto_core_salsa208_OUTPUTBYTES 64U -#define crypto_core_salsa208_INPUTBYTES 16U -#define crypto_core_salsa208_KEYBYTES 32U -#define crypto_core_salsa208_CONSTBYTES 16U - #ifdef __cplusplus extern "C" { #endif +#define crypto_core_salsa208_OUTPUTBYTES 64U SODIUM_EXPORT size_t crypto_core_salsa208_outputbytes(void); +#define crypto_core_salsa208_INPUTBYTES 16U SODIUM_EXPORT size_t crypto_core_salsa208_inputbytes(void); +#define crypto_core_salsa208_KEYBYTES 32U SODIUM_EXPORT size_t crypto_core_salsa208_keybytes(void); +#define crypto_core_salsa208_CONSTBYTES 16U SODIUM_EXPORT size_t crypto_core_salsa208_constbytes(void); diff --git a/src/libsodium/include/sodium/crypto_generichash.h b/src/libsodium/include/sodium/crypto_generichash.h index 317df1fa..851ada42 100644 --- a/src/libsodium/include/sodium/crypto_generichash.h +++ b/src/libsodium/include/sodium/crypto_generichash.h @@ -13,10 +13,6 @@ extern "C" { #endif -#define crypto_generichash_BYTES crypto_generichash_blake2b_BYTES -SODIUM_EXPORT -size_t crypto_generichash_bytes(void); - #define crypto_generichash_BYTES_MIN crypto_generichash_blake2b_BYTES_MIN SODIUM_EXPORT size_t crypto_generichash_bytes_min(void); @@ -25,9 +21,9 @@ size_t crypto_generichash_bytes_min(void); SODIUM_EXPORT size_t crypto_generichash_bytes_max(void); -#define crypto_generichash_KEYBYTES crypto_generichash_blake2b_KEYBYTES +#define crypto_generichash_BYTES crypto_generichash_blake2b_BYTES SODIUM_EXPORT -size_t crypto_generichash_keybytes(void); +size_t crypto_generichash_bytes(void); #define crypto_generichash_KEYBYTES_MIN crypto_generichash_blake2b_KEYBYTES_MIN SODIUM_EXPORT @@ -37,9 +33,9 @@ size_t crypto_generichash_keybytes_min(void); SODIUM_EXPORT size_t crypto_generichash_keybytes_max(void); -#define crypto_generichash_BLOCKBYTES crypto_generichash_blake2b_BLOCKBYTES +#define crypto_generichash_KEYBYTES crypto_generichash_blake2b_KEYBYTES SODIUM_EXPORT -size_t crypto_generichash_blockbytes(void); +size_t crypto_generichash_keybytes(void); #define crypto_generichash_PRIMITIVE "blake2b" SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_generichash_blake2b.h b/src/libsodium/include/sodium/crypto_generichash_blake2b.h index f7a3a5fd..61a5e646 100644 --- a/src/libsodium/include/sodium/crypto_generichash_blake2b.h +++ b/src/libsodium/include/sodium/crypto_generichash_blake2b.h @@ -7,16 +7,6 @@ #include "export.h" -#define crypto_generichash_blake2b_BYTES 32U -#define crypto_generichash_blake2b_BYTES_MIN 16U -#define crypto_generichash_blake2b_BYTES_MAX 64U -#define crypto_generichash_blake2b_KEYBYTES 32U -#define crypto_generichash_blake2b_KEYBYTES_MIN 16U -#define crypto_generichash_blake2b_KEYBYTES_MAX 64U -#define crypto_generichash_blake2b_BLOCKBYTES 128U -#define crypto_generichash_blake2b_SALTBYTES 16U -#define crypto_generichash_blake2b_PERSONALBYTES 16U - #if defined(_MSC_VER) # define CRYPTO_ALIGN(x) __declspec(align(x)) #else @@ -35,30 +25,41 @@ CRYPTO_ALIGN(64) typedef struct crypto_generichash_blake2b_state { uint64_t h[8]; uint64_t t[2]; uint64_t f[2]; - uint8_t buf[2 * crypto_generichash_blake2b_BLOCKBYTES]; + uint8_t buf[2 * 128]; size_t buflen; uint8_t last_node; } crypto_generichash_blake2b_state; #pragma pack(pop) +#define crypto_generichash_blake2b_BYTES_MIN 16U SODIUM_EXPORT size_t crypto_generichash_blake2b_bytes_min(void); +#define crypto_generichash_blake2b_BYTES_MAX 64U SODIUM_EXPORT size_t crypto_generichash_blake2b_bytes_max(void); +#define crypto_generichash_blake2b_BYTES 32U +SODIUM_EXPORT +size_t crypto_generichash_blake2b_bytes(void); + +#define crypto_generichash_blake2b_KEYBYTES_MIN 16U SODIUM_EXPORT size_t crypto_generichash_blake2b_keybytes_min(void); +#define crypto_generichash_blake2b_KEYBYTES_MAX 64U SODIUM_EXPORT size_t crypto_generichash_blake2b_keybytes_max(void); +#define crypto_generichash_blake2b_KEYBYTES 32U SODIUM_EXPORT -size_t crypto_generichash_blake2b_blockbytes(void); +size_t crypto_generichash_blake2b_keybytes(void); +#define crypto_generichash_blake2b_SALTBYTES 16U SODIUM_EXPORT size_t crypto_generichash_blake2b_saltbytes(void); +#define crypto_generichash_blake2b_PERSONALBYTES 16U SODIUM_EXPORT size_t crypto_generichash_blake2b_personalbytes(void); diff --git a/src/libsodium/include/sodium/crypto_hash.h b/src/libsodium/include/sodium/crypto_hash.h index 3aa732dd..acc68f8a 100644 --- a/src/libsodium/include/sodium/crypto_hash.h +++ b/src/libsodium/include/sodium/crypto_hash.h @@ -4,10 +4,6 @@ #include "crypto_hash_sha512.h" #include "export.h" -#define crypto_hash_BYTES crypto_hash_sha512_BYTES -#define crypto_hash_BLOCKBYTES crypto_hash_sha512_BLOCKBYTES -#define crypto_hash_PRIMITIVE "sha512" - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -15,10 +11,15 @@ extern "C" { #endif +#define crypto_hash_BYTES crypto_hash_sha512_BYTES +SODIUM_EXPORT +size_t crypto_hash_bytes(void); + SODIUM_EXPORT int crypto_hash(unsigned char *out, const unsigned char *in, unsigned long long inlen); +#define crypto_hash_PRIMITIVE "sha512" SODIUM_EXPORT const char *crypto_hash_primitive(void); diff --git a/src/libsodium/include/sodium/crypto_hash_sha256.h b/src/libsodium/include/sodium/crypto_hash_sha256.h index f2bf63e1..04424706 100644 --- a/src/libsodium/include/sodium/crypto_hash_sha256.h +++ b/src/libsodium/include/sodium/crypto_hash_sha256.h @@ -7,9 +7,6 @@ #include "export.h" -#define crypto_hash_sha256_BYTES 32U -#define crypto_hash_sha256_BLOCKBYTES 64U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -23,6 +20,7 @@ typedef struct crypto_hash_sha256_state { unsigned char buf[64]; } crypto_hash_sha256_state; +#define crypto_hash_sha256_BYTES 32U SODIUM_EXPORT size_t crypto_hash_sha256_bytes(void); diff --git a/src/libsodium/include/sodium/crypto_hash_sha512.h b/src/libsodium/include/sodium/crypto_hash_sha512.h index 2363310e..ea7e8bc6 100644 --- a/src/libsodium/include/sodium/crypto_hash_sha512.h +++ b/src/libsodium/include/sodium/crypto_hash_sha512.h @@ -7,9 +7,6 @@ #include "export.h" -#define crypto_hash_sha512_BYTES 64U -#define crypto_hash_sha512_BLOCKBYTES 128U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -23,6 +20,7 @@ typedef struct crypto_hash_sha512_state { unsigned char buf[128]; } crypto_hash_sha512_state; +#define crypto_hash_sha512_BYTES 64U SODIUM_EXPORT size_t crypto_hash_sha512_bytes(void); diff --git a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h index 9351b8e4..c61f8d35 100644 --- a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +++ b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h @@ -4,8 +4,6 @@ #include #include "export.h" -#define crypto_onetimeauth_poly1305_BYTES 16U -#define crypto_onetimeauth_poly1305_KEYBYTES 32U #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -30,9 +28,11 @@ typedef struct crypto_onetimeauth_poly1305_implementation { const unsigned char *k); } crypto_onetimeauth_poly1305_implementation; +#define crypto_onetimeauth_poly1305_BYTES 16U SODIUM_EXPORT size_t crypto_onetimeauth_poly1305_bytes(void); +#define crypto_onetimeauth_poly1305_KEYBYTES 32U SODIUM_EXPORT size_t crypto_onetimeauth_poly1305_keybytes(void); diff --git a/src/libsodium/include/sodium/crypto_pwhash_scryptxsalsa208sha256.h b/src/libsodium/include/sodium/crypto_pwhash_scryptxsalsa208sha256.h index 606bab66..d995848a 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_scryptxsalsa208sha256.h +++ b/src/libsodium/include/sodium/crypto_pwhash_scryptxsalsa208sha256.h @@ -5,9 +5,6 @@ #include "export.h" -#define crypto_pwhash_scryptxsalsa208sha256_SALTBYTES 32 -#define crypto_pwhash_scryptxsalsa208sha256_STRBYTES 102 - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -15,9 +12,11 @@ extern "C" { #endif +#define crypto_pwhash_scryptxsalsa208sha256_SALTBYTES 32 SODIUM_EXPORT size_t crypto_pwhash_scryptxsalsa208sha256_saltbytes(void); +#define crypto_pwhash_scryptxsalsa208sha256_STRBYTES 102 SODIUM_EXPORT size_t crypto_pwhash_scryptxsalsa208sha256_strbytes(void); diff --git a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h index 5042c44a..eebca47e 100644 --- a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +++ b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h @@ -4,12 +4,6 @@ #include #include "export.h" -#define crypto_secretbox_xsalsa20poly1305_KEYBYTES 32U -#define crypto_secretbox_xsalsa20poly1305_NONCEBYTES 24U -#define crypto_secretbox_xsalsa20poly1305_ZEROBYTES 32U -#define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 16U -#define crypto_secretbox_xsalsa20poly1305_MACBYTES (crypto_secretbox_xsalsa20poly1305_ZEROBYTES - crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES) - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -17,18 +11,25 @@ extern "C" { #endif +#define crypto_secretbox_xsalsa20poly1305_KEYBYTES 32U SODIUM_EXPORT size_t crypto_secretbox_xsalsa20poly1305_keybytes(void); +#define crypto_secretbox_xsalsa20poly1305_NONCEBYTES 24U SODIUM_EXPORT size_t crypto_secretbox_xsalsa20poly1305_noncebytes(void); +#define crypto_secretbox_xsalsa20poly1305_ZEROBYTES 32U SODIUM_EXPORT size_t crypto_secretbox_xsalsa20poly1305_zerobytes(void); +#define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 16U SODIUM_EXPORT size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes(void); +#define crypto_secretbox_xsalsa20poly1305_MACBYTES \ + (crypto_secretbox_xsalsa20poly1305_ZEROBYTES - \ + crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES) SODIUM_EXPORT size_t crypto_secretbox_xsalsa20poly1305_macbytes(void); diff --git a/src/libsodium/include/sodium/crypto_shorthash_siphash24.h b/src/libsodium/include/sodium/crypto_shorthash_siphash24.h index 9d409751..c482dbd6 100644 --- a/src/libsodium/include/sodium/crypto_shorthash_siphash24.h +++ b/src/libsodium/include/sodium/crypto_shorthash_siphash24.h @@ -4,9 +4,6 @@ #include #include "export.h" -#define crypto_shorthash_siphash24_BYTES 8U -#define crypto_shorthash_siphash24_KEYBYTES 16U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -14,9 +11,11 @@ extern "C" { #endif +#define crypto_shorthash_siphash24_BYTES 8U SODIUM_EXPORT size_t crypto_shorthash_siphash24_bytes(void); +#define crypto_shorthash_siphash24_KEYBYTES 16U SODIUM_EXPORT size_t crypto_shorthash_siphash24_keybytes(void); diff --git a/src/libsodium/include/sodium/crypto_sign_ed25519.h b/src/libsodium/include/sodium/crypto_sign_ed25519.h index 7c0b28f4..38a02ae7 100644 --- a/src/libsodium/include/sodium/crypto_sign_ed25519.h +++ b/src/libsodium/include/sodium/crypto_sign_ed25519.h @@ -4,11 +4,6 @@ #include #include "export.h" -#define crypto_sign_ed25519_SECRETKEYBYTES (32U + 32U) -#define crypto_sign_ed25519_PUBLICKEYBYTES 32U -#define crypto_sign_ed25519_SEEDBYTES 32U -#define crypto_sign_ed25519_BYTES 64U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -16,15 +11,19 @@ extern "C" { #endif +#define crypto_sign_ed25519_BYTES 64U SODIUM_EXPORT size_t crypto_sign_ed25519_bytes(void); +#define crypto_sign_ed25519_SEEDBYTES 32U SODIUM_EXPORT size_t crypto_sign_ed25519_seedbytes(void); +#define crypto_sign_ed25519_PUBLICKEYBYTES 32U SODIUM_EXPORT size_t crypto_sign_ed25519_publickeybytes(void); +#define crypto_sign_ed25519_SECRETKEYBYTES (32U + 32U) SODIUM_EXPORT size_t crypto_sign_ed25519_secretkeybytes(void); diff --git a/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h b/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h index 7ce8572b..d6cca441 100644 --- a/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +++ b/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h @@ -4,10 +4,6 @@ #include #include "export.h" -#define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES (32U + 32U) -#define crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES 32U -#define crypto_sign_edwards25519sha512batch_BYTES 64U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -15,12 +11,15 @@ extern "C" { #endif +#define crypto_sign_edwards25519sha512batch_BYTES 64U SODIUM_EXPORT size_t crypto_sign_edwards25519sha512batch_bytes(void); +#define crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES 32U SODIUM_EXPORT size_t crypto_sign_edwards25519sha512batch_publickeybytes(void); +#define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES (32U + 32U) SODIUM_EXPORT size_t crypto_sign_edwards25519sha512batch_secretkeybytes(void); diff --git a/src/libsodium/include/sodium/crypto_stream_aes128ctr.h b/src/libsodium/include/sodium/crypto_stream_aes128ctr.h index 5ef84885..787af777 100644 --- a/src/libsodium/include/sodium/crypto_stream_aes128ctr.h +++ b/src/libsodium/include/sodium/crypto_stream_aes128ctr.h @@ -12,10 +12,6 @@ #include #include "export.h" -#define crypto_stream_aes128ctr_KEYBYTES 16U -#define crypto_stream_aes128ctr_NONCEBYTES 16U -#define crypto_stream_aes128ctr_BEFORENMBYTES 1408U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -23,12 +19,15 @@ extern "C" { #endif +#define crypto_stream_aes128ctr_KEYBYTES 16U SODIUM_EXPORT size_t crypto_stream_aes128ctr_keybytes(void); +#define crypto_stream_aes128ctr_NONCEBYTES 16U SODIUM_EXPORT size_t crypto_stream_aes128ctr_noncebytes(void); +#define crypto_stream_aes128ctr_BEFORENMBYTES 1408U SODIUM_EXPORT size_t crypto_stream_aes128ctr_beforenmbytes(void); diff --git a/src/libsodium/include/sodium/crypto_stream_aes256estream.h b/src/libsodium/include/sodium/crypto_stream_aes256estream.h index 2de0bfe0..a61e40fa 100644 --- a/src/libsodium/include/sodium/crypto_stream_aes256estream.h +++ b/src/libsodium/include/sodium/crypto_stream_aes256estream.h @@ -13,10 +13,6 @@ #include #include "export.h" -#define crypto_stream_aes256estream_KEYBYTES 32U -#define crypto_stream_aes256estream_NONCEBYTES 16U -#define crypto_stream_aes256estream_BEFORENMBYTES 276U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -24,12 +20,15 @@ extern "C" { #endif +#define crypto_stream_aes256estream_KEYBYTES 32U SODIUM_EXPORT size_t crypto_stream_aes256estream_keybytes(void); +#define crypto_stream_aes256estream_NONCEBYTES 16U SODIUM_EXPORT size_t crypto_stream_aes256estream_noncebytes(void); +#define crypto_stream_aes256estream_BEFORENMBYTES 276U SODIUM_EXPORT size_t crypto_stream_aes256estream_beforenmbytes(void); diff --git a/src/libsodium/include/sodium/crypto_stream_xsalsa20.h b/src/libsodium/include/sodium/crypto_stream_xsalsa20.h index 8fb5dcf0..8f69c649 100644 --- a/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +++ b/src/libsodium/include/sodium/crypto_stream_xsalsa20.h @@ -12,9 +12,6 @@ #include #include "export.h" -#define crypto_stream_xsalsa20_KEYBYTES 32U -#define crypto_stream_xsalsa20_NONCEBYTES 24U - #ifdef __cplusplus # if __GNUC__ # pragma GCC diagnostic ignored "-Wlong-long" @@ -22,9 +19,11 @@ extern "C" { #endif +#define crypto_stream_xsalsa20_KEYBYTES 32U SODIUM_EXPORT size_t crypto_stream_xsalsa20_keybytes(void); +#define crypto_stream_xsalsa20_NONCEBYTES 24U SODIUM_EXPORT size_t crypto_stream_xsalsa20_noncebytes(void); diff --git a/src/libsodium/include/sodium/crypto_verify_16.h b/src/libsodium/include/sodium/crypto_verify_16.h index 972a02f3..1ead16e4 100644 --- a/src/libsodium/include/sodium/crypto_verify_16.h +++ b/src/libsodium/include/sodium/crypto_verify_16.h @@ -4,12 +4,11 @@ #include #include "export.h" -#define crypto_verify_16_BYTES 16U - #ifdef __cplusplus extern "C" { #endif +#define crypto_verify_16_BYTES 16U SODIUM_EXPORT size_t crypto_verify_16_bytes(void); diff --git a/src/libsodium/include/sodium/crypto_verify_32.h b/src/libsodium/include/sodium/crypto_verify_32.h index f3ada230..59a3ba67 100644 --- a/src/libsodium/include/sodium/crypto_verify_32.h +++ b/src/libsodium/include/sodium/crypto_verify_32.h @@ -4,12 +4,11 @@ #include #include "export.h" -#define crypto_verify_32_BYTES 32U - #ifdef __cplusplus extern "C" { #endif +#define crypto_verify_32_BYTES 32U SODIUM_EXPORT size_t crypto_verify_32_bytes(void); diff --git a/src/libsodium/include/sodium/crypto_verify_64.h b/src/libsodium/include/sodium/crypto_verify_64.h index 4835826e..bd42dc34 100644 --- a/src/libsodium/include/sodium/crypto_verify_64.h +++ b/src/libsodium/include/sodium/crypto_verify_64.h @@ -4,12 +4,11 @@ #include #include "export.h" -#define crypto_verify_64_BYTES 64U - #ifdef __cplusplus extern "C" { #endif +#define crypto_verify_64_BYTES 64U SODIUM_EXPORT size_t crypto_verify_64_bytes(void);