diff --git a/src/libsodium/include/sodium/crypto_aead_aes256gcm.h b/src/libsodium/include/sodium/crypto_aead_aes256gcm.h index 5e67aa99..752586cc 100644 --- a/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +++ b/src/libsodium/include/sodium/crypto_aead_aes256gcm.h @@ -70,7 +70,8 @@ int crypto_aead_aes256gcm_encrypt(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull(1, 8, 9))); SODIUM_EXPORT int crypto_aead_aes256gcm_decrypt(unsigned char *m, @@ -82,7 +83,7 @@ int crypto_aead_aes256gcm_decrypt(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(4, 8, 9))); SODIUM_EXPORT int crypto_aead_aes256gcm_encrypt_detached(unsigned char *c, @@ -94,7 +95,8 @@ int crypto_aead_aes256gcm_encrypt_detached(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull(1, 2, 9, 10))); SODIUM_EXPORT int crypto_aead_aes256gcm_decrypt_detached(unsigned char *m, @@ -106,13 +108,14 @@ int crypto_aead_aes256gcm_decrypt_detached(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5, 8, 9))); /* -- Precomputation interface -- */ SODIUM_EXPORT int crypto_aead_aes256gcm_beforenm(crypto_aead_aes256gcm_state *ctx_, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, @@ -123,7 +126,8 @@ int crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_); + const crypto_aead_aes256gcm_state *ctx_) + __attribute__ ((nonnull(1, 8, 9))); SODIUM_EXPORT int crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, @@ -135,7 +139,7 @@ int crypto_aead_aes256gcm_decrypt_afternm(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const crypto_aead_aes256gcm_state *ctx_) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(4, 8, 9))); SODIUM_EXPORT int crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, @@ -147,7 +151,8 @@ int crypto_aead_aes256gcm_encrypt_detached_afternm(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const crypto_aead_aes256gcm_state *ctx_); + const crypto_aead_aes256gcm_state *ctx_) + __attribute__ ((nonnull(1, 2, 9, 10))); SODIUM_EXPORT int crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m, @@ -159,10 +164,11 @@ int crypto_aead_aes256gcm_decrypt_detached_afternm(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const crypto_aead_aes256gcm_state *ctx_) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5, 8, 9))); SODIUM_EXPORT -void crypto_aead_aes256gcm_keygen(unsigned char k[crypto_aead_aes256gcm_KEYBYTES]); +void crypto_aead_aes256gcm_keygen(unsigned char k[crypto_aead_aes256gcm_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h b/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h index 8ab31243..5d671df1 100644 --- a/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h @@ -45,7 +45,8 @@ int crypto_aead_chacha20poly1305_ietf_encrypt(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull(1, 8, 9))); SODIUM_EXPORT int crypto_aead_chacha20poly1305_ietf_decrypt(unsigned char *m, @@ -57,7 +58,7 @@ int crypto_aead_chacha20poly1305_ietf_decrypt(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(4, 8, 9))); SODIUM_EXPORT int crypto_aead_chacha20poly1305_ietf_encrypt_detached(unsigned char *c, @@ -69,7 +70,8 @@ int crypto_aead_chacha20poly1305_ietf_encrypt_detached(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull(1, 2, 9, 10))); SODIUM_EXPORT int crypto_aead_chacha20poly1305_ietf_decrypt_detached(unsigned char *m, @@ -81,10 +83,11 @@ int crypto_aead_chacha20poly1305_ietf_decrypt_detached(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5, 8, 9))); SODIUM_EXPORT -void crypto_aead_chacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_chacha20poly1305_ietf_KEYBYTES]); +void crypto_aead_chacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_chacha20poly1305_ietf_KEYBYTES]) + __attribute__ ((nonnull)); /* -- Original ChaCha20-Poly1305 construction with a 64-bit nonce and a 64-bit internal counter -- */ @@ -118,7 +121,8 @@ int crypto_aead_chacha20poly1305_encrypt(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull(1, 8, 9))); SODIUM_EXPORT int crypto_aead_chacha20poly1305_decrypt(unsigned char *m, @@ -130,7 +134,7 @@ int crypto_aead_chacha20poly1305_decrypt(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(4, 8, 9))); SODIUM_EXPORT int crypto_aead_chacha20poly1305_encrypt_detached(unsigned char *c, @@ -142,7 +146,8 @@ int crypto_aead_chacha20poly1305_encrypt_detached(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull(1, 2, 9, 10))); SODIUM_EXPORT int crypto_aead_chacha20poly1305_decrypt_detached(unsigned char *m, @@ -154,10 +159,11 @@ int crypto_aead_chacha20poly1305_decrypt_detached(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5, 8, 9))); SODIUM_EXPORT -void crypto_aead_chacha20poly1305_keygen(unsigned char k[crypto_aead_chacha20poly1305_KEYBYTES]); +void crypto_aead_chacha20poly1305_keygen(unsigned char k[crypto_aead_chacha20poly1305_KEYBYTES]) + __attribute__ ((nonnull)); /* Aliases */ diff --git a/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h index 99692aae..a13b2247 100644 --- a/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h @@ -41,7 +41,8 @@ int crypto_aead_xchacha20poly1305_ietf_encrypt(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull(1, 8, 9))); SODIUM_EXPORT int crypto_aead_xchacha20poly1305_ietf_decrypt(unsigned char *m, @@ -53,7 +54,7 @@ int crypto_aead_xchacha20poly1305_ietf_decrypt(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(4, 8, 9))); SODIUM_EXPORT int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(unsigned char *c, @@ -65,7 +66,8 @@ int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(unsigned char *c, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull(1, 2, 9, 10))); SODIUM_EXPORT int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(unsigned char *m, @@ -77,10 +79,11 @@ int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(unsigned char *m, unsigned long long adlen, const unsigned char *npub, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5, 9, 9))); SODIUM_EXPORT -void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES]); +void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES]) + __attribute__ ((nonnull)); /* Aliases */ diff --git a/src/libsodium/include/sodium/crypto_auth.h b/src/libsodium/include/sodium/crypto_auth.h index 7174e7bc..d0fc8ee2 100644 --- a/src/libsodium/include/sodium/crypto_auth.h +++ b/src/libsodium/include/sodium/crypto_auth.h @@ -27,15 +27,17 @@ const char *crypto_auth_primitive(void); SODIUM_EXPORT int crypto_auth(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); + unsigned long long inlen, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_verify(const unsigned char *h, const unsigned char *in, unsigned long long inlen, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES]); +void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha256.h b/src/libsodium/include/sodium/crypto_auth_hmacsha256.h index deec5266..aa4ecfd8 100644 --- a/src/libsodium/include/sodium/crypto_auth_hmacsha256.h +++ b/src/libsodium/include/sodium/crypto_auth_hmacsha256.h @@ -24,14 +24,14 @@ SODIUM_EXPORT int crypto_auth_hmacsha256(unsigned char *out, const unsigned char *in, unsigned long long inlen, - const unsigned char *k); + const unsigned char *k) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_hmacsha256_verify(const unsigned char *h, const unsigned char *in, unsigned long long inlen, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); /* ------------------------------------------------------------------------- */ @@ -46,20 +46,22 @@ size_t crypto_auth_hmacsha256_statebytes(void); SODIUM_EXPORT int crypto_auth_hmacsha256_init(crypto_auth_hmacsha256_state *state, const unsigned char *key, - size_t keylen); + size_t keylen) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_hmacsha256_update(crypto_auth_hmacsha256_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state *state, - unsigned char *out); + unsigned char *out) __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_auth_hmacsha256_keygen(unsigned char k[crypto_auth_hmacsha256_KEYBYTES]); +void crypto_auth_hmacsha256_keygen(unsigned char k[crypto_auth_hmacsha256_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha512.h b/src/libsodium/include/sodium/crypto_auth_hmacsha512.h index 77a55fbc..c5012583 100644 --- a/src/libsodium/include/sodium/crypto_auth_hmacsha512.h +++ b/src/libsodium/include/sodium/crypto_auth_hmacsha512.h @@ -24,14 +24,14 @@ SODIUM_EXPORT int crypto_auth_hmacsha512(unsigned char *out, const unsigned char *in, unsigned long long inlen, - const unsigned char *k); + const unsigned char *k) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_hmacsha512_verify(const unsigned char *h, const unsigned char *in, unsigned long long inlen, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); /* ------------------------------------------------------------------------- */ @@ -46,19 +46,20 @@ size_t crypto_auth_hmacsha512_statebytes(void); SODIUM_EXPORT int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state, const unsigned char *key, - size_t keylen); + size_t keylen) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state, - unsigned char *out); + unsigned char *out) __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_auth_hmacsha512_keygen(unsigned char k[crypto_auth_hmacsha512_KEYBYTES]); +void crypto_auth_hmacsha512_keygen(unsigned char k[crypto_auth_hmacsha512_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h b/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h index 4842f3de..0f266104 100644 --- a/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h +++ b/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h @@ -29,7 +29,7 @@ int crypto_auth_hmacsha512256_verify(const unsigned char *h, const unsigned char *in, unsigned long long inlen, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); /* ------------------------------------------------------------------------- */ @@ -41,19 +41,20 @@ size_t crypto_auth_hmacsha512256_statebytes(void); SODIUM_EXPORT int crypto_auth_hmacsha512256_init(crypto_auth_hmacsha512256_state *state, const unsigned char *key, - size_t keylen); + size_t keylen) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_hmacsha512256_update(crypto_auth_hmacsha512256_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_auth_hmacsha512256_final(crypto_auth_hmacsha512256_state *state, - unsigned char *out); + unsigned char *out) __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_auth_hmacsha512256_keygen(unsigned char k[crypto_auth_hmacsha512256_KEYBYTES]); +void crypto_auth_hmacsha512256_keygen(unsigned char k[crypto_auth_hmacsha512256_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_box.h b/src/libsodium/include/sodium/crypto_box.h index 99ee19a8..f6fe3ccb 100644 --- a/src/libsodium/include/sodium/crypto_box.h +++ b/src/libsodium/include/sodium/crypto_box.h @@ -50,29 +50,31 @@ const char *crypto_box_primitive(void); SODIUM_EXPORT int crypto_box_seed_keypair(unsigned char *pk, unsigned char *sk, - const unsigned char *seed); + const unsigned char *seed) + __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_box_keypair(unsigned char *pk, unsigned char *sk); +int crypto_box_keypair(unsigned char *pk, unsigned char *sk) + __attribute__ ((nonnull)); SODIUM_EXPORT int 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) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_open_easy(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5, 6))); SODIUM_EXPORT int crypto_box_detached(unsigned char *c, unsigned char *mac, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_open_detached(unsigned char *m, const unsigned char *c, @@ -81,7 +83,7 @@ int crypto_box_open_detached(unsigned char *m, const unsigned char *c, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6, 7))); /* -- Precomputation interface -- */ @@ -92,30 +94,31 @@ size_t crypto_box_beforenmbytes(void); SODIUM_EXPORT int crypto_box_beforenm(unsigned char *k, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_open_easy_afternm(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); SODIUM_EXPORT int crypto_box_detached_afternm(unsigned char *c, unsigned char *mac, const unsigned char *m, unsigned long long mlen, - const unsigned char *n, const unsigned char *k); + const unsigned char *n, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_open_detached_afternm(unsigned char *m, const unsigned char *c, const unsigned char *mac, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6))); /* -- Ephemeral SK interface -- */ @@ -125,13 +128,14 @@ size_t crypto_box_sealbytes(void); SODIUM_EXPORT int crypto_box_seal(unsigned char *c, const unsigned char *m, - unsigned long long mlen, const unsigned char *pk); + unsigned long long mlen, const unsigned char *pk) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_seal_open(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); /* -- NaCl compatibility interface ; Requires padding -- */ @@ -147,24 +151,24 @@ SODIUM_EXPORT int crypto_box(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_open(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5, 6))); SODIUM_EXPORT int crypto_box_afternm(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_open_afternm(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h index c1cf7566..0d3937a7 100644 --- a/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h @@ -45,11 +45,13 @@ size_t crypto_box_curve25519xchacha20poly1305_messagebytes_max(void); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_seed_keypair(unsigned char *pk, unsigned char *sk, - const unsigned char *seed); + const unsigned char *seed) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_keypair(unsigned char *pk, - unsigned char *sk); + unsigned char *sk) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_easy(unsigned char *c, @@ -58,7 +60,7 @@ int crypto_box_curve25519xchacha20poly1305_easy(unsigned char *c, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_open_easy(unsigned char *m, @@ -67,7 +69,7 @@ int crypto_box_curve25519xchacha20poly1305_open_easy(unsigned char *m, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5, 6))); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_detached(unsigned char *c, @@ -77,7 +79,7 @@ int crypto_box_curve25519xchacha20poly1305_detached(unsigned char *c, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_open_detached(unsigned char *m, @@ -87,7 +89,7 @@ int crypto_box_curve25519xchacha20poly1305_open_detached(unsigned char *m, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6, 7))); /* -- Precomputation interface -- */ @@ -95,14 +97,15 @@ SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_beforenm(unsigned char *k, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_easy_afternm(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_open_easy_afternm(unsigned char *m, @@ -110,7 +113,7 @@ int crypto_box_curve25519xchacha20poly1305_open_easy_afternm(unsigned char *m, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_detached_afternm(unsigned char *c, @@ -118,7 +121,8 @@ int crypto_box_curve25519xchacha20poly1305_detached_afternm(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_open_detached_afternm(unsigned char *m, @@ -127,7 +131,7 @@ int crypto_box_curve25519xchacha20poly1305_open_detached_afternm(unsigned char * unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6))); /* -- Ephemeral SK interface -- */ @@ -142,7 +146,8 @@ SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_seal(unsigned char *c, const unsigned char *m, unsigned long long mlen, - const unsigned char *pk); + const unsigned char *pk) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xchacha20poly1305_seal_open(unsigned char *m, @@ -150,7 +155,7 @@ int crypto_box_curve25519xchacha20poly1305_seal_open(unsigned char *m, unsigned long long clen, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h index c5b15f42..f889430c 100644 --- a/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +++ b/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h @@ -45,17 +45,19 @@ size_t crypto_box_curve25519xsalsa20poly1305_messagebytes_max(void); SODIUM_EXPORT int crypto_box_curve25519xsalsa20poly1305_seed_keypair(unsigned char *pk, unsigned char *sk, - const unsigned char *seed); + const unsigned char *seed) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk, - unsigned char *sk); + unsigned char *sk) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char *k, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); /* -- NaCl compatibility interface ; Requires padding -- */ @@ -76,7 +78,7 @@ int crypto_box_curve25519xsalsa20poly1305(unsigned char *c, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m, @@ -85,14 +87,15 @@ int crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m, const unsigned char *n, const unsigned char *pk, const unsigned char *sk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5, 6))); SODIUM_EXPORT int crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char *m, @@ -100,7 +103,7 @@ int crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char *m, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_core_ed25519.h b/src/libsodium/include/sodium/crypto_core_ed25519.h index 1536294b..ed25f66b 100644 --- a/src/libsodium/include/sodium/crypto_core_ed25519.h +++ b/src/libsodium/include/sodium/crypto_core_ed25519.h @@ -17,18 +17,22 @@ SODIUM_EXPORT size_t crypto_core_ed25519_uniformbytes(void); SODIUM_EXPORT -int crypto_core_ed25519_is_valid_point(const unsigned char *p); +int crypto_core_ed25519_is_valid_point(const unsigned char *p) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_core_ed25519_add(unsigned char *r, - const unsigned char *p, const unsigned char *q); + const unsigned char *p, const unsigned char *q) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_core_ed25519_sub(unsigned char *r, - const unsigned char *p, const unsigned char *q); + const unsigned char *p, const unsigned char *q) + __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r); +int crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_core_hchacha20.h b/src/libsodium/include/sodium/crypto_core_hchacha20.h index 05e5670c..ece141b0 100644 --- a/src/libsodium/include/sodium/crypto_core_hchacha20.h +++ b/src/libsodium/include/sodium/crypto_core_hchacha20.h @@ -26,7 +26,8 @@ size_t crypto_core_hchacha20_constbytes(void); SODIUM_EXPORT int crypto_core_hchacha20(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); + const unsigned char *k, const unsigned char *c) + __attribute__ ((nonnull(1, 2, 3))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_core_hsalsa20.h b/src/libsodium/include/sodium/crypto_core_hsalsa20.h index 82e475b8..4bf7a487 100644 --- a/src/libsodium/include/sodium/crypto_core_hsalsa20.h +++ b/src/libsodium/include/sodium/crypto_core_hsalsa20.h @@ -26,7 +26,8 @@ size_t crypto_core_hsalsa20_constbytes(void); SODIUM_EXPORT int crypto_core_hsalsa20(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); + const unsigned char *k, const unsigned char *c) + __attribute__ ((nonnull(1, 2, 3))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_core_salsa20.h b/src/libsodium/include/sodium/crypto_core_salsa20.h index 160cc56d..bd79fd9f 100644 --- a/src/libsodium/include/sodium/crypto_core_salsa20.h +++ b/src/libsodium/include/sodium/crypto_core_salsa20.h @@ -26,7 +26,8 @@ size_t crypto_core_salsa20_constbytes(void); SODIUM_EXPORT int crypto_core_salsa20(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); + const unsigned char *k, const unsigned char *c) + __attribute__ ((nonnull(1, 2, 3))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_core_salsa2012.h b/src/libsodium/include/sodium/crypto_core_salsa2012.h index bdd5f9fd..05957591 100644 --- a/src/libsodium/include/sodium/crypto_core_salsa2012.h +++ b/src/libsodium/include/sodium/crypto_core_salsa2012.h @@ -26,7 +26,8 @@ size_t crypto_core_salsa2012_constbytes(void); SODIUM_EXPORT int crypto_core_salsa2012(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); + const unsigned char *k, const unsigned char *c) + __attribute__ ((nonnull(1, 2, 3))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_core_salsa208.h b/src/libsodium/include/sodium/crypto_core_salsa208.h index 876bda89..d2f216af 100644 --- a/src/libsodium/include/sodium/crypto_core_salsa208.h +++ b/src/libsodium/include/sodium/crypto_core_salsa208.h @@ -30,7 +30,8 @@ size_t crypto_core_salsa208_constbytes(void) SODIUM_EXPORT int crypto_core_salsa208(unsigned char *out, const unsigned char *in, - const unsigned char *k, const unsigned char *c); + const unsigned char *k, const unsigned char *c) + __attribute__ ((nonnull(1, 2, 3))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_generichash.h b/src/libsodium/include/sodium/crypto_generichash.h index a5e1646f..c255dc71 100644 --- a/src/libsodium/include/sodium/crypto_generichash.h +++ b/src/libsodium/include/sodium/crypto_generichash.h @@ -53,24 +53,29 @@ size_t crypto_generichash_statebytes(void); SODIUM_EXPORT int crypto_generichash(unsigned char *out, size_t outlen, const unsigned char *in, unsigned long long inlen, - const unsigned char *key, size_t keylen); + const unsigned char *key, size_t keylen) + __attribute__ ((nonnull(1))); SODIUM_EXPORT int crypto_generichash_init(crypto_generichash_state *state, const unsigned char *key, - const size_t keylen, const size_t outlen); + const size_t keylen, const size_t outlen) + __attribute__ ((nonnull(1))); SODIUM_EXPORT int crypto_generichash_update(crypto_generichash_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_generichash_final(crypto_generichash_state *state, - unsigned char *out, const size_t outlen); + unsigned char *out, const size_t outlen) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_generichash_keygen(unsigned char k[crypto_generichash_KEYBYTES]); +void crypto_generichash_keygen(unsigned char k[crypto_generichash_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_generichash_blake2b.h b/src/libsodium/include/sodium/crypto_generichash_blake2b.h index 9326a04a..f1110a4d 100644 --- a/src/libsodium/include/sodium/crypto_generichash_blake2b.h +++ b/src/libsodium/include/sodium/crypto_generichash_blake2b.h @@ -74,7 +74,8 @@ SODIUM_EXPORT int crypto_generichash_blake2b(unsigned char *out, size_t outlen, const unsigned char *in, unsigned long long inlen, - const unsigned char *key, size_t keylen); + const unsigned char *key, size_t keylen) + __attribute__ ((nonnull(1))); SODIUM_EXPORT int crypto_generichash_blake2b_salt_personal(unsigned char *out, size_t outlen, @@ -83,32 +84,37 @@ int crypto_generichash_blake2b_salt_personal(unsigned char *out, size_t outlen, const unsigned char *key, size_t keylen, const unsigned char *salt, - const unsigned char *personal); + const unsigned char *personal) + __attribute__ ((nonnull(1))); SODIUM_EXPORT int crypto_generichash_blake2b_init(crypto_generichash_blake2b_state *state, const unsigned char *key, - const size_t keylen, const size_t outlen); + const size_t keylen, const size_t outlen) + __attribute__ ((nonnull(1))); SODIUM_EXPORT int crypto_generichash_blake2b_init_salt_personal(crypto_generichash_blake2b_state *state, const unsigned char *key, const size_t keylen, const size_t outlen, const unsigned char *salt, - const unsigned char *personal); + const unsigned char *personal) + __attribute__ ((nonnull(1))); SODIUM_EXPORT int crypto_generichash_blake2b_update(crypto_generichash_blake2b_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_generichash_blake2b_final(crypto_generichash_blake2b_state *state, unsigned char *out, - const size_t outlen); + const size_t outlen) __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_generichash_blake2b_keygen(unsigned char k[crypto_generichash_blake2b_KEYBYTES]); +void crypto_generichash_blake2b_keygen(unsigned char k[crypto_generichash_blake2b_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_hash.h b/src/libsodium/include/sodium/crypto_hash.h index 302ed5c5..4b16c477 100644 --- a/src/libsodium/include/sodium/crypto_hash.h +++ b/src/libsodium/include/sodium/crypto_hash.h @@ -26,7 +26,7 @@ size_t crypto_hash_bytes(void); SODIUM_EXPORT int crypto_hash(unsigned char *out, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) __attribute__ ((nonnull)); #define crypto_hash_PRIMITIVE "sha512" SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_hash_sha256.h b/src/libsodium/include/sodium/crypto_hash_sha256.h index f64d16e0..306f1e93 100644 --- a/src/libsodium/include/sodium/crypto_hash_sha256.h +++ b/src/libsodium/include/sodium/crypto_hash_sha256.h @@ -36,19 +36,22 @@ size_t crypto_hash_sha256_bytes(void); SODIUM_EXPORT int crypto_hash_sha256(unsigned char *out, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_hash_sha256_init(crypto_hash_sha256_state *state); +int crypto_hash_sha256_init(crypto_hash_sha256_state *state) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_hash_sha256_update(crypto_hash_sha256_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_hash_sha256_final(crypto_hash_sha256_state *state, - unsigned char *out); + unsigned char *out) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_hash_sha512.h b/src/libsodium/include/sodium/crypto_hash_sha512.h index 6b0330f1..7fb830c6 100644 --- a/src/libsodium/include/sodium/crypto_hash_sha512.h +++ b/src/libsodium/include/sodium/crypto_hash_sha512.h @@ -36,19 +36,22 @@ size_t crypto_hash_sha512_bytes(void); SODIUM_EXPORT int crypto_hash_sha512(unsigned char *out, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_hash_sha512_init(crypto_hash_sha512_state *state); +int crypto_hash_sha512_init(crypto_hash_sha512_state *state) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_hash_sha512_update(crypto_hash_sha512_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_hash_sha512_final(crypto_hash_sha512_state *state, - unsigned char *out); + unsigned char *out) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_kdf.h b/src/libsodium/include/sodium/crypto_kdf.h index 52e496a7..ac2fc618 100644 --- a/src/libsodium/include/sodium/crypto_kdf.h +++ b/src/libsodium/include/sodium/crypto_kdf.h @@ -39,10 +39,12 @@ SODIUM_EXPORT int crypto_kdf_derive_from_key(unsigned char *subkey, size_t subkey_len, uint64_t subkey_id, const char ctx[crypto_kdf_CONTEXTBYTES], - const unsigned char key[crypto_kdf_KEYBYTES]); + const unsigned char key[crypto_kdf_KEYBYTES]) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES]); +void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_kdf_blake2b.h b/src/libsodium/include/sodium/crypto_kdf_blake2b.h index 5480ebe8..3ae47dd3 100644 --- a/src/libsodium/include/sodium/crypto_kdf_blake2b.h +++ b/src/libsodium/include/sodium/crypto_kdf_blake2b.h @@ -34,7 +34,9 @@ SODIUM_EXPORT int crypto_kdf_blake2b_derive_from_key(unsigned char *subkey, size_t subkey_len, uint64_t subkey_id, const char ctx[crypto_kdf_blake2b_CONTEXTBYTES], - const unsigned char key[crypto_kdf_blake2b_KEYBYTES]); + const unsigned char key[crypto_kdf_blake2b_KEYBYTES]) + __attribute__ ((nonnull)); + #ifdef __cplusplus } #endif diff --git a/src/libsodium/include/sodium/crypto_kx.h b/src/libsodium/include/sodium/crypto_kx.h index d1fce90d..347132c3 100644 --- a/src/libsodium/include/sodium/crypto_kx.h +++ b/src/libsodium/include/sodium/crypto_kx.h @@ -35,11 +35,13 @@ const char *crypto_kx_primitive(void); SODIUM_EXPORT int crypto_kx_seed_keypair(unsigned char pk[crypto_kx_PUBLICKEYBYTES], unsigned char sk[crypto_kx_SECRETKEYBYTES], - const unsigned char seed[crypto_kx_SEEDBYTES]); + const unsigned char seed[crypto_kx_SEEDBYTES]) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_kx_keypair(unsigned char pk[crypto_kx_PUBLICKEYBYTES], - unsigned char sk[crypto_kx_SECRETKEYBYTES]); + unsigned char sk[crypto_kx_SECRETKEYBYTES]) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_kx_client_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES], @@ -47,7 +49,7 @@ int crypto_kx_client_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES], const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES], const unsigned char client_sk[crypto_kx_SECRETKEYBYTES], const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES]) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 4, 5))); SODIUM_EXPORT int crypto_kx_server_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES], @@ -55,7 +57,7 @@ int crypto_kx_server_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES], const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES], const unsigned char server_sk[crypto_kx_SECRETKEYBYTES], const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES]) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 4, 5))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_onetimeauth.h b/src/libsodium/include/sodium/crypto_onetimeauth.h index 5951c5b8..803dbac8 100644 --- a/src/libsodium/include/sodium/crypto_onetimeauth.h +++ b/src/libsodium/include/sodium/crypto_onetimeauth.h @@ -32,28 +32,31 @@ const char *crypto_onetimeauth_primitive(void); SODIUM_EXPORT int crypto_onetimeauth(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); + unsigned long long inlen, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in, unsigned long long inlen, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_onetimeauth_init(crypto_onetimeauth_state *state, - const unsigned char *key); + const unsigned char *key) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_onetimeauth_update(crypto_onetimeauth_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_onetimeauth_final(crypto_onetimeauth_state *state, - unsigned char *out); + unsigned char *out) __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_onetimeauth_keygen(unsigned char k[crypto_onetimeauth_KEYBYTES]); +void crypto_onetimeauth_keygen(unsigned char k[crypto_onetimeauth_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h index 4b89c4f0..516f7db3 100644 --- a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +++ b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h @@ -35,30 +35,35 @@ SODIUM_EXPORT int crypto_onetimeauth_poly1305(unsigned char *out, const unsigned char *in, unsigned long long inlen, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_onetimeauth_poly1305_verify(const unsigned char *h, const unsigned char *in, unsigned long long inlen, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state, - const unsigned char *key); + const unsigned char *key) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state, const unsigned char *in, - unsigned long long inlen); + unsigned long long inlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state, - unsigned char *out); + unsigned char *out) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_onetimeauth_poly1305_keygen(unsigned char k[crypto_onetimeauth_poly1305_KEYBYTES]); +void crypto_onetimeauth_poly1305_keygen(unsigned char k[crypto_onetimeauth_poly1305_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_pwhash.h b/src/libsodium/include/sodium/crypto_pwhash.h index 2c76461f..585a993e 100644 --- a/src/libsodium/include/sodium/crypto_pwhash.h +++ b/src/libsodium/include/sodium/crypto_pwhash.h @@ -105,7 +105,7 @@ int crypto_pwhash(unsigned char * const out, unsigned long long outlen, const char * const passwd, unsigned long long passwdlen, const unsigned char * const salt, unsigned long long opslimit, size_t memlimit, int alg) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); /* * The output string already includes all the required parameters, including @@ -116,24 +116,24 @@ SODIUM_EXPORT int crypto_pwhash_str(char out[crypto_pwhash_STRBYTES], const char * const passwd, unsigned long long passwdlen, unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_str_alg(char out[crypto_pwhash_STRBYTES], const char * const passwd, unsigned long long passwdlen, unsigned long long opslimit, size_t memlimit, int alg) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES], const char * const passwd, unsigned long long passwdlen) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES], unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #define crypto_pwhash_PRIMITIVE "argon2i" SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_pwhash_argon2i.h b/src/libsodium/include/sodium/crypto_pwhash_argon2i.h index 8e4c1c35..88ff6221 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +++ b/src/libsodium/include/sodium/crypto_pwhash_argon2i.h @@ -95,25 +95,25 @@ int crypto_pwhash_argon2i(unsigned char * const out, const unsigned char * const salt, unsigned long long opslimit, size_t memlimit, int alg) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES], const char * const passwd, unsigned long long passwdlen, unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES], const char * const passwd, unsigned long long passwdlen) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_argon2i_str_needs_rehash(const char str[crypto_pwhash_argon2i_STRBYTES], unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_pwhash_argon2id.h b/src/libsodium/include/sodium/crypto_pwhash_argon2id.h index 51b17aa8..7183abd1 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_argon2id.h +++ b/src/libsodium/include/sodium/crypto_pwhash_argon2id.h @@ -95,25 +95,25 @@ int crypto_pwhash_argon2id(unsigned char * const out, const unsigned char * const salt, unsigned long long opslimit, size_t memlimit, int alg) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_argon2id_str(char out[crypto_pwhash_argon2id_STRBYTES], const char * const passwd, unsigned long long passwdlen, unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_argon2id_str_verify(const char str[crypto_pwhash_argon2id_STRBYTES], const char * const passwd, unsigned long long passwdlen) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_argon2id_str_needs_rehash(const char str[crypto_pwhash_argon2id_STRBYTES], unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h b/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h index 951b87b9..5c0bf7d3 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +++ b/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h @@ -84,7 +84,7 @@ int crypto_pwhash_scryptsalsa208sha256(unsigned char * const out, const unsigned char * const salt, unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208sha256_STRBYTES], @@ -92,26 +92,26 @@ int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208 unsigned long long passwdlen, unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], const char * const passwd, unsigned long long passwdlen) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t r, uint32_t p, uint8_t * buf, size_t buflen) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], unsigned long long opslimit, size_t memlimit) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_scalarmult.h b/src/libsodium/include/sodium/crypto_scalarmult.h index f7fa6f8f..01a8e3ea 100644 --- a/src/libsodium/include/sodium/crypto_scalarmult.h +++ b/src/libsodium/include/sodium/crypto_scalarmult.h @@ -23,7 +23,8 @@ SODIUM_EXPORT const char *crypto_scalarmult_primitive(void); SODIUM_EXPORT -int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); +int crypto_scalarmult_base(unsigned char *q, const unsigned char *n) + __attribute__ ((nonnull)); /* * NOTE: Do not use the result of this function directly. @@ -36,7 +37,7 @@ int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); SODIUM_EXPORT int crypto_scalarmult(unsigned char *q, const unsigned char *n, const unsigned char *p) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h b/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h index ae85eadc..e5605cb2 100644 --- a/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h +++ b/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h @@ -28,10 +28,12 @@ size_t crypto_scalarmult_curve25519_scalarbytes(void); SODIUM_EXPORT int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n, const unsigned char *p) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n); +int crypto_scalarmult_curve25519_base(unsigned char *q, + const unsigned char *n) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h b/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h index 3d512351..39e0d92c 100644 --- a/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h +++ b/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h @@ -29,10 +29,11 @@ size_t crypto_scalarmult_ed25519_scalarbytes(void); SODIUM_EXPORT int crypto_scalarmult_ed25519(unsigned char *q, const unsigned char *n, const unsigned char *p) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_scalarmult_ed25519_base(unsigned char *q, const unsigned char *n); +int crypto_scalarmult_ed25519_base(unsigned char *q, const unsigned char *n) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_secretbox.h b/src/libsodium/include/sodium/crypto_secretbox.h index 55e94a02..eae44877 100644 --- a/src/libsodium/include/sodium/crypto_secretbox.h +++ b/src/libsodium/include/sodium/crypto_secretbox.h @@ -36,20 +36,21 @@ size_t crypto_secretbox_messagebytes_max(void); SODIUM_EXPORT int crypto_secretbox_easy(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretbox_open_easy(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); SODIUM_EXPORT int crypto_secretbox_detached(unsigned char *c, unsigned char *mac, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretbox_open_detached(unsigned char *m, @@ -58,10 +59,11 @@ int crypto_secretbox_open_detached(unsigned char *m, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6))); SODIUM_EXPORT -void crypto_secretbox_keygen(unsigned char k[crypto_secretbox_KEYBYTES]); +void crypto_secretbox_keygen(unsigned char k[crypto_secretbox_KEYBYTES]) + __attribute__ ((nonnull)); /* -- NaCl compatibility interface ; Requires padding -- */ @@ -76,13 +78,13 @@ size_t crypto_secretbox_boxzerobytes(void); SODIUM_EXPORT int crypto_secretbox(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretbox_open(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h index 2919da16..e7948f2c 100644 --- a/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h @@ -34,7 +34,8 @@ int crypto_secretbox_xchacha20poly1305_easy(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretbox_xchacha20poly1305_open_easy(unsigned char *m, @@ -42,7 +43,7 @@ int crypto_secretbox_xchacha20poly1305_open_easy(unsigned char *m, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); SODIUM_EXPORT int crypto_secretbox_xchacha20poly1305_detached(unsigned char *c, @@ -50,7 +51,8 @@ int crypto_secretbox_xchacha20poly1305_detached(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretbox_xchacha20poly1305_open_detached(unsigned char *m, @@ -59,7 +61,7 @@ int crypto_secretbox_xchacha20poly1305_open_detached(unsigned char *m, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 3, 5, 6))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h index 4b8c7c8e..1c72d6c0 100644 --- a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +++ b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h @@ -35,7 +35,8 @@ int crypto_secretbox_xsalsa20poly1305(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretbox_xsalsa20poly1305_open(unsigned char *m, @@ -43,10 +44,11 @@ int crypto_secretbox_xsalsa20poly1305_open(unsigned char *m, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); SODIUM_EXPORT -void crypto_secretbox_xsalsa20poly1305_keygen(unsigned char k[crypto_secretbox_xsalsa20poly1305_KEYBYTES]); +void crypto_secretbox_xsalsa20poly1305_keygen(unsigned char k[crypto_secretbox_xsalsa20poly1305_KEYBYTES]) + __attribute__ ((nonnull)); /* -- NaCl compatibility interface ; Requires padding -- */ diff --git a/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h b/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h index dac273b5..b22e4e93 100644 --- a/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h +++ b/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h @@ -64,33 +64,38 @@ size_t crypto_secretstream_xchacha20poly1305_statebytes(void); SODIUM_EXPORT void crypto_secretstream_xchacha20poly1305_keygen - (unsigned char k[crypto_secretstream_xchacha20poly1305_KEYBYTES]); + (unsigned char k[crypto_secretstream_xchacha20poly1305_KEYBYTES]) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretstream_xchacha20poly1305_init_push (crypto_secretstream_xchacha20poly1305_state *state, unsigned char header[crypto_secretstream_xchacha20poly1305_HEADERBYTES], - const unsigned char k[crypto_secretstream_xchacha20poly1305_KEYBYTES]); + const unsigned char k[crypto_secretstream_xchacha20poly1305_KEYBYTES]) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretstream_xchacha20poly1305_push (crypto_secretstream_xchacha20poly1305_state *state, unsigned char *c, unsigned long long *clen_p, const unsigned char *m, unsigned long long mlen, - const unsigned char *ad, unsigned long long adlen, unsigned char tag); + const unsigned char *ad, unsigned long long adlen, unsigned char tag) + __attribute__ ((nonnull(1))); SODIUM_EXPORT int crypto_secretstream_xchacha20poly1305_init_pull (crypto_secretstream_xchacha20poly1305_state *state, const unsigned char header[crypto_secretstream_xchacha20poly1305_HEADERBYTES], - const unsigned char k[crypto_secretstream_xchacha20poly1305_KEYBYTES]); + const unsigned char k[crypto_secretstream_xchacha20poly1305_KEYBYTES]) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_secretstream_xchacha20poly1305_pull (crypto_secretstream_xchacha20poly1305_state *state, unsigned char *m, unsigned long long *mlen_p, unsigned char *tag_p, const unsigned char *c, unsigned long long clen, - const unsigned char *ad, unsigned long long adlen); + const unsigned char *ad, unsigned long long adlen) + __attribute__ ((nonnull(1))); SODIUM_EXPORT void crypto_secretstream_xchacha20poly1305_rekey diff --git a/src/libsodium/include/sodium/crypto_shorthash.h b/src/libsodium/include/sodium/crypto_shorthash.h index a4988082..dc8b2480 100644 --- a/src/libsodium/include/sodium/crypto_shorthash.h +++ b/src/libsodium/include/sodium/crypto_shorthash.h @@ -27,10 +27,12 @@ const char *crypto_shorthash_primitive(void); SODIUM_EXPORT int crypto_shorthash(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); + unsigned long long inlen, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_shorthash_keygen(unsigned char k[crypto_shorthash_KEYBYTES]); +void crypto_shorthash_keygen(unsigned char k[crypto_shorthash_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_shorthash_siphash24.h b/src/libsodium/include/sodium/crypto_shorthash_siphash24.h index 745ed48f..912e9d8c 100644 --- a/src/libsodium/include/sodium/crypto_shorthash_siphash24.h +++ b/src/libsodium/include/sodium/crypto_shorthash_siphash24.h @@ -23,7 +23,8 @@ size_t crypto_shorthash_siphash24_keybytes(void); SODIUM_EXPORT int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); + unsigned long long inlen, const unsigned char *k) + __attribute__ ((nonnull)); #ifndef SODIUM_LIBRARY_MINIMAL /* -- 128-bit output -- */ @@ -38,7 +39,8 @@ size_t crypto_shorthash_siphashx24_keybytes(void); SODIUM_EXPORT int crypto_shorthash_siphashx24(unsigned char *out, const unsigned char *in, - unsigned long long inlen, const unsigned char *k); + unsigned long long inlen, const unsigned char *k) + __attribute__ ((nonnull)); #endif #ifdef __cplusplus diff --git a/src/libsodium/include/sodium/crypto_sign.h b/src/libsodium/include/sodium/crypto_sign.h index 85aff0c9..9d4b17e4 100644 --- a/src/libsodium/include/sodium/crypto_sign.h +++ b/src/libsodium/include/sodium/crypto_sign.h @@ -51,50 +51,54 @@ const char *crypto_sign_primitive(void); SODIUM_EXPORT int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk, - const unsigned char *seed); + const unsigned char *seed) + __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_sign_keypair(unsigned char *pk, unsigned char *sk); +int crypto_sign_keypair(unsigned char *pk, unsigned char *sk) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign(unsigned char *sm, unsigned long long *smlen_p, const unsigned char *m, unsigned long long mlen, - const unsigned char *sk); + const unsigned char *sk) __attribute__ ((nonnull(1, 3, 5))); SODIUM_EXPORT int crypto_sign_open(unsigned char *m, unsigned long long *mlen_p, const unsigned char *sm, unsigned long long smlen, const unsigned char *pk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5))); SODIUM_EXPORT int crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p, const unsigned char *m, unsigned long long mlen, - const unsigned char *sk); + const unsigned char *sk) __attribute__ ((nonnull(1, 3, 5))); SODIUM_EXPORT int crypto_sign_verify_detached(const unsigned char *sig, const unsigned char *m, unsigned long long mlen, const unsigned char *pk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_init(crypto_sign_state *state); SODIUM_EXPORT int crypto_sign_update(crypto_sign_state *state, - const unsigned char *m, unsigned long long mlen); + const unsigned char *m, unsigned long long mlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_final_create(crypto_sign_state *state, unsigned char *sig, unsigned long long *siglen_p, - const unsigned char *sk); + const unsigned char *sk) + __attribute__ ((nonnull(1, 2, 4))); SODIUM_EXPORT int crypto_sign_final_verify(crypto_sign_state *state, unsigned char *sig, const unsigned char *pk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_sign_ed25519.h b/src/libsodium/include/sodium/crypto_sign_ed25519.h index 38d2b9dd..ddbe8586 100644 --- a/src/libsodium/include/sodium/crypto_sign_ed25519.h +++ b/src/libsodium/include/sodium/crypto_sign_ed25519.h @@ -42,20 +42,22 @@ size_t crypto_sign_ed25519_messagebytes_max(void); SODIUM_EXPORT int crypto_sign_ed25519(unsigned char *sm, unsigned long long *smlen_p, const unsigned char *m, unsigned long long mlen, - const unsigned char *sk); + const unsigned char *sk) + __attribute__ ((nonnull(1, 3, 5))); SODIUM_EXPORT int crypto_sign_ed25519_open(unsigned char *m, unsigned long long *mlen_p, const unsigned char *sm, unsigned long long smlen, const unsigned char *pk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5))); SODIUM_EXPORT int crypto_sign_ed25519_detached(unsigned char *sig, unsigned long long *siglen_p, const unsigned char *m, unsigned long long mlen, - const unsigned char *sk); + const unsigned char *sk) + __attribute__ ((nonnull(1, 3))); SODIUM_EXPORT int crypto_sign_ed25519_verify_detached(const unsigned char *sig, @@ -65,47 +67,55 @@ int crypto_sign_ed25519_verify_detached(const unsigned char *sig, __attribute__ ((warn_unused_result)); SODIUM_EXPORT -int crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk); +int crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk, - const unsigned char *seed); + const unsigned char *seed) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk, const unsigned char *ed25519_pk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk, - const unsigned char *ed25519_sk); + const unsigned char *ed25519_sk) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_ed25519_sk_to_seed(unsigned char *seed, - const unsigned char *sk); + const unsigned char *sk) + __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_sign_ed25519_sk_to_pk(unsigned char *pk, const unsigned char *sk); +int crypto_sign_ed25519_sk_to_pk(unsigned char *pk, const unsigned char *sk) + __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_sign_ed25519ph_init(crypto_sign_ed25519ph_state *state); +int crypto_sign_ed25519ph_init(crypto_sign_ed25519ph_state *state) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_ed25519ph_update(crypto_sign_ed25519ph_state *state, const unsigned char *m, - unsigned long long mlen); + unsigned long long mlen) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_ed25519ph_final_create(crypto_sign_ed25519ph_state *state, unsigned char *sig, unsigned long long *siglen_p, - const unsigned char *sk); + const unsigned char *sk) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_sign_ed25519ph_final_verify(crypto_sign_ed25519ph_state *state, unsigned char *sig, const unsigned char *pk) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h b/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h index 4bb91924..e69339a4 100644 --- a/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +++ b/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h @@ -33,7 +33,7 @@ int crypto_sign_edwards25519sha512batch(unsigned char *sm, const unsigned char *m, unsigned long long mlen, const unsigned char *sk) - __attribute__ ((deprecated)); + __attribute__ ((deprecated)) __attribute__ ((nonnull(1, 3, 5))); SODIUM_EXPORT int crypto_sign_edwards25519sha512batch_open(unsigned char *m, @@ -41,12 +41,12 @@ int crypto_sign_edwards25519sha512batch_open(unsigned char *m, const unsigned char *sm, unsigned long long smlen, const unsigned char *pk) - __attribute__ ((deprecated)); + __attribute__ ((deprecated)) __attribute__ ((nonnull(3, 5))); SODIUM_EXPORT int crypto_sign_edwards25519sha512batch_keypair(unsigned char *pk, unsigned char *sk) - __attribute__ ((deprecated)); + __attribute__ ((deprecated)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_stream.h b/src/libsodium/include/sodium/crypto_stream.h index d288f0b6..88dab5f6 100644 --- a/src/libsodium/include/sodium/crypto_stream.h +++ b/src/libsodium/include/sodium/crypto_stream.h @@ -39,15 +39,18 @@ const char *crypto_stream_primitive(void); SODIUM_EXPORT int crypto_stream(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); + const unsigned char *n, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_xor(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_stream_keygen(unsigned char k[crypto_stream_KEYBYTES]); +void crypto_stream_keygen(unsigned char k[crypto_stream_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_stream_chacha20.h b/src/libsodium/include/sodium/crypto_stream_chacha20.h index d3e2b234..40889755 100644 --- a/src/libsodium/include/sodium/crypto_stream_chacha20.h +++ b/src/libsodium/include/sodium/crypto_stream_chacha20.h @@ -36,21 +36,25 @@ size_t crypto_stream_chacha20_messagebytes_max(void); SODIUM_EXPORT int crypto_stream_chacha20(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); + const unsigned char *n, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, uint64_t ic, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_stream_chacha20_keygen(unsigned char k[crypto_stream_chacha20_KEYBYTES]); +void crypto_stream_chacha20_keygen(unsigned char k[crypto_stream_chacha20_KEYBYTES]) + __attribute__ ((nonnull)); /* ChaCha20 with a 96-bit nonce and a 32-bit counter (IETF) */ @@ -69,21 +73,25 @@ size_t crypto_stream_chacha20_ietf_messagebytes_max(void); SODIUM_EXPORT int crypto_stream_chacha20_ietf(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); + const unsigned char *n, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_chacha20_ietf_xor(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_chacha20_ietf_xor_ic(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, uint32_t ic, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_stream_chacha20_ietf_keygen(unsigned char k[crypto_stream_chacha20_ietf_KEYBYTES]); +void crypto_stream_chacha20_ietf_keygen(unsigned char k[crypto_stream_chacha20_ietf_KEYBYTES]) + __attribute__ ((nonnull)); /* Aliases */ diff --git a/src/libsodium/include/sodium/crypto_stream_salsa20.h b/src/libsodium/include/sodium/crypto_stream_salsa20.h index 0c7688c7..45b3b3e3 100644 --- a/src/libsodium/include/sodium/crypto_stream_salsa20.h +++ b/src/libsodium/include/sodium/crypto_stream_salsa20.h @@ -34,21 +34,25 @@ size_t crypto_stream_salsa20_messagebytes_max(void); SODIUM_EXPORT int crypto_stream_salsa20(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); + const unsigned char *n, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_salsa20_xor(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_salsa20_xor_ic(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, uint64_t ic, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_stream_salsa20_keygen(unsigned char k[crypto_stream_salsa20_KEYBYTES]); +void crypto_stream_salsa20_keygen(unsigned char k[crypto_stream_salsa20_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_stream_salsa2012.h b/src/libsodium/include/sodium/crypto_stream_salsa2012.h index c93d1c81..6c5d303c 100644 --- a/src/libsodium/include/sodium/crypto_stream_salsa2012.h +++ b/src/libsodium/include/sodium/crypto_stream_salsa2012.h @@ -33,15 +33,18 @@ size_t crypto_stream_salsa2012_messagebytes_max(void); SODIUM_EXPORT int crypto_stream_salsa2012(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); + const unsigned char *n, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_salsa2012_xor(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_stream_salsa2012_keygen(unsigned char k[crypto_stream_salsa2012_KEYBYTES]); +void crypto_stream_salsa2012_keygen(unsigned char k[crypto_stream_salsa2012_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_stream_salsa208.h b/src/libsodium/include/sodium/crypto_stream_salsa208.h index 653f6504..d574f304 100644 --- a/src/libsodium/include/sodium/crypto_stream_salsa208.h +++ b/src/libsodium/include/sodium/crypto_stream_salsa208.h @@ -37,17 +37,17 @@ size_t crypto_stream_salsa208_messagebytes_max(void) SODIUM_EXPORT int crypto_stream_salsa208(unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((deprecated)); + __attribute__ ((deprecated)) __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_salsa208_xor(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, const unsigned char *k) - __attribute__ ((deprecated)); + __attribute__ ((deprecated)) __attribute__ ((nonnull)); SODIUM_EXPORT void crypto_stream_salsa208_keygen(unsigned char k[crypto_stream_salsa208_KEYBYTES]) - __attribute__ ((deprecated)); + __attribute__ ((deprecated)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_stream_xchacha20.h b/src/libsodium/include/sodium/crypto_stream_xchacha20.h index cf0407ff..c4002db0 100644 --- a/src/libsodium/include/sodium/crypto_stream_xchacha20.h +++ b/src/libsodium/include/sodium/crypto_stream_xchacha20.h @@ -34,21 +34,25 @@ size_t crypto_stream_xchacha20_messagebytes_max(void); SODIUM_EXPORT int crypto_stream_xchacha20(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); + const unsigned char *n, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_xchacha20_xor(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_xchacha20_xor_ic(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, uint64_t ic, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_stream_xchacha20_keygen(unsigned char k[crypto_stream_xchacha20_KEYBYTES]); +void crypto_stream_xchacha20_keygen(unsigned char k[crypto_stream_xchacha20_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_stream_xsalsa20.h b/src/libsodium/include/sodium/crypto_stream_xsalsa20.h index cb4c44a8..20034e34 100644 --- a/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +++ b/src/libsodium/include/sodium/crypto_stream_xsalsa20.h @@ -34,21 +34,25 @@ size_t crypto_stream_xsalsa20_messagebytes_max(void); SODIUM_EXPORT int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen, - const unsigned char *n, const unsigned char *k); + const unsigned char *n, const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_xsalsa20_xor(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT int crypto_stream_xsalsa20_xor_ic(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, uint64_t ic, - const unsigned char *k); + const unsigned char *k) + __attribute__ ((nonnull)); SODIUM_EXPORT -void crypto_stream_xsalsa20_keygen(unsigned char k[crypto_stream_xsalsa20_KEYBYTES]); +void crypto_stream_xsalsa20_keygen(unsigned char k[crypto_stream_xsalsa20_KEYBYTES]) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_verify_16.h b/src/libsodium/include/sodium/crypto_verify_16.h index 5e9eeabe..7b9c8077 100644 --- a/src/libsodium/include/sodium/crypto_verify_16.h +++ b/src/libsodium/include/sodium/crypto_verify_16.h @@ -14,7 +14,7 @@ size_t crypto_verify_16_bytes(void); SODIUM_EXPORT int crypto_verify_16(const unsigned char *x, const unsigned char *y) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_verify_32.h b/src/libsodium/include/sodium/crypto_verify_32.h index 281b5a1b..9b0f4529 100644 --- a/src/libsodium/include/sodium/crypto_verify_32.h +++ b/src/libsodium/include/sodium/crypto_verify_32.h @@ -14,7 +14,7 @@ size_t crypto_verify_32_bytes(void); SODIUM_EXPORT int crypto_verify_32(const unsigned char *x, const unsigned char *y) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_verify_64.h b/src/libsodium/include/sodium/crypto_verify_64.h index 0dc7c304..c83b7302 100644 --- a/src/libsodium/include/sodium/crypto_verify_64.h +++ b/src/libsodium/include/sodium/crypto_verify_64.h @@ -14,7 +14,7 @@ size_t crypto_verify_64_bytes(void); SODIUM_EXPORT int crypto_verify_64(const unsigned char *x, const unsigned char *y) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/randombytes.h b/src/libsodium/include/sodium/randombytes.h index d19f684e..a03cc657 100644 --- a/src/libsodium/include/sodium/randombytes.h +++ b/src/libsodium/include/sodium/randombytes.h @@ -32,11 +32,13 @@ SODIUM_EXPORT size_t randombytes_seedbytes(void); SODIUM_EXPORT -void randombytes_buf(void * const buf, const size_t size); +void randombytes_buf(void * const buf, const size_t size) + __attribute__ ((nonnull)); SODIUM_EXPORT void randombytes_buf_deterministic(void * const buf, const size_t size, - const unsigned char seed[randombytes_SEEDBYTES]); + const unsigned char seed[randombytes_SEEDBYTES]) + __attribute__ ((nonnull)); SODIUM_EXPORT uint32_t randombytes_random(void); @@ -51,7 +53,8 @@ SODIUM_EXPORT int randombytes_close(void); SODIUM_EXPORT -int randombytes_set_implementation(randombytes_implementation *impl); +int randombytes_set_implementation(randombytes_implementation *impl) + __attribute__ ((nonnull)); SODIUM_EXPORT const char *randombytes_implementation_name(void); @@ -59,7 +62,8 @@ const char *randombytes_implementation_name(void); /* -- NaCl compatibility interface -- */ SODIUM_EXPORT -void randombytes(unsigned char * const buf, const unsigned long long buf_len); +void randombytes(unsigned char * const buf, const unsigned long long buf_len) + __attribute__ ((nonnull)); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/utils.h b/src/libsodium/include/sodium/utils.h index 46eb331c..92ac2e69 100644 --- a/src/libsodium/include/sodium/utils.h +++ b/src/libsodium/include/sodium/utils.h @@ -19,7 +19,7 @@ extern "C" { #endif SODIUM_EXPORT -void sodium_memzero(void * const pnt, const size_t len); +void sodium_memzero(void * const pnt, const size_t len) __attribute__ ((nonnull)); SODIUM_EXPORT void sodium_stackzero(const size_t len); @@ -32,7 +32,7 @@ void sodium_stackzero(const size_t len); */ SODIUM_EXPORT int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); /* * sodium_compare() returns -1 if b1_ < b2_, 1 if b1_ > b2_ and 0 if b1_ == b2_ @@ -43,7 +43,7 @@ int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len) SODIUM_EXPORT int sodium_compare(const unsigned char *b1_, const unsigned char *b2_, size_t len) - __attribute__ ((warn_unused_result)); + __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT int sodium_is_zero(const unsigned char *n, const size_t nlen); @@ -52,17 +52,20 @@ SODIUM_EXPORT void sodium_increment(unsigned char *n, const size_t nlen); SODIUM_EXPORT -void sodium_add(unsigned char *a, const unsigned char *b, const size_t len); +void sodium_add(unsigned char *a, const unsigned char *b, const size_t len) + __attribute__ ((nonnull)); SODIUM_EXPORT char *sodium_bin2hex(char * const hex, const size_t hex_maxlen, - const unsigned char * const bin, const size_t bin_len); + const unsigned char * const bin, const size_t bin_len) + __attribute__ ((nonnull)); SODIUM_EXPORT int sodium_hex2bin(unsigned char * const bin, const size_t bin_maxlen, const char * const hex, const size_t hex_len, const char * const ignore, size_t * const bin_len, - const char ** const hex_end); + const char ** const hex_end) + __attribute__ ((nonnull(1, 3))); #define sodium_base64_VARIANT_ORIGINAL 1 #define sodium_base64_VARIANT_ORIGINAL_NO_PADDING 3 @@ -84,19 +87,22 @@ size_t sodium_base64_encoded_len(const size_t bin_len, const int variant); SODIUM_EXPORT char *sodium_bin2base64(char * const b64, const size_t b64_maxlen, const unsigned char * const bin, const size_t bin_len, - const int variant); + const int variant) __attribute__ ((nonnull)); SODIUM_EXPORT int sodium_base642bin(unsigned char * const bin, const size_t bin_maxlen, const char * const b64, const size_t b64_len, const char * const ignore, size_t * const bin_len, - const char ** const b64_end, const int variant); + const char ** const b64_end, const int variant) + __attribute__ ((nonnull(1, 3))); SODIUM_EXPORT -int sodium_mlock(void * const addr, const size_t len); +int sodium_mlock(void * const addr, const size_t len) + __attribute__ ((nonnull)); SODIUM_EXPORT -int sodium_munlock(void * const addr, const size_t len); +int sodium_munlock(void * const addr, const size_t len) + __attribute__ ((nonnull)); /* WARNING: sodium_malloc() and sodium_allocarray() are not general-purpose * allocation functions. @@ -143,21 +149,23 @@ SODIUM_EXPORT void sodium_free(void *ptr); SODIUM_EXPORT -int sodium_mprotect_noaccess(void *ptr); +int sodium_mprotect_noaccess(void *ptr) __attribute__ ((nonnull)); SODIUM_EXPORT -int sodium_mprotect_readonly(void *ptr); +int sodium_mprotect_readonly(void *ptr) __attribute__ ((nonnull)); SODIUM_EXPORT -int sodium_mprotect_readwrite(void *ptr); +int sodium_mprotect_readwrite(void *ptr) __attribute__ ((nonnull)); SODIUM_EXPORT int sodium_pad(size_t *padded_buflen_p, unsigned char *buf, - size_t unpadded_buflen, size_t blocksize, size_t max_buflen); + size_t unpadded_buflen, size_t blocksize, size_t max_buflen) + __attribute__ ((nonnull(2))); SODIUM_EXPORT int sodium_unpad(size_t *unpadded_buflen_p, const unsigned char *buf, - size_t padded_buflen, size_t blocksize); + size_t padded_buflen, size_t blocksize) + __attribute__ ((nonnull(2))); /* -------- */