Increase strictness of NULL parameter validity in Cipher's doxygen

This commit is contained in:
k-stachowiak 2018-12-19 11:22:40 +01:00
parent d409285cfa
commit 6df25e7930

View File

@ -600,9 +600,8 @@ int mbedtls_cipher_set_padding_mode( mbedtls_cipher_context_t *ctx,
* *
* \param ctx The generic cipher context. This must be initialized and * \param ctx The generic cipher context. This must be initialized and
* bound to a cipher information structure. * bound to a cipher information structure.
* \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. If * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. This
* `iv_len > 0`, this may be \c NULL, otherwise this must be a * must be a readable buffer of at least \p iv_len Bytes.
* readable buffer of at least \p iv_len Bytes.
* \param iv_len The IV length for ciphers with variable-size IV. * \param iv_len The IV length for ciphers with variable-size IV.
* This parameter is discarded by ciphers with fixed-size IV. * This parameter is discarded by ciphers with fixed-size IV.
* *
@ -633,9 +632,8 @@ int mbedtls_cipher_reset( mbedtls_cipher_context_t *ctx );
* mbedtls_cipher_reset(). * mbedtls_cipher_reset().
* *
* \param ctx The generic cipher context. This must be initialized. * \param ctx The generic cipher context. This must be initialized.
* \param ad The additional data to use. If `ad_len > 0`, then this * \param ad The additional data to use. This must be a readable
* must be a readable buffer of at least \p ad_len Bytes, * buffer of at least \p ad_len Bytes.
* otherwise this may be \c NULL.
* \param ad_len the Length of \p ad Bytes. * \param ad_len the Length of \p ad Bytes.
* *
* \return \c 0 on success. * \return \c 0 on success.
@ -663,8 +661,7 @@ int mbedtls_cipher_update_ad( mbedtls_cipher_context_t *ctx,
* \param ctx The generic cipher context. This must be initialized and * \param ctx The generic cipher context. This must be initialized and
* bound to a key. * bound to a key.
* \param input The buffer holding the input data. This must be a * \param input The buffer holding the input data. This must be a
* readable buffer of at least \p ilen Bytes. If * readable buffer of at least \p ilen Bytes.
* `ilen == 0`, this may be \c NULL.
* \param ilen The length of the input data. * \param ilen The length of the input data.
* \param output The buffer for the output data. This must be able to * \param output The buffer for the output data. This must be able to
* hold at least `ilen + block_size`. This must not be the * hold at least `ilen + block_size`. This must not be the
@ -719,8 +716,7 @@ int mbedtls_cipher_finish( mbedtls_cipher_context_t *ctx,
* operation through mbedtls_cipher_finish() the tag for * operation through mbedtls_cipher_finish() the tag for
* which should be written. * which should be written.
* \param tag The buffer to write the tag to. This must be a writable * \param tag The buffer to write the tag to. This must be a writable
* buffer of at least \p tag_len Bytes. If `tag_len == 0`, * buffer of at least \p tag_len Bytes.
* this may be \c NULL.
* \param tag_len The length of the tag to write. * \param tag_len The length of the tag to write.
* *
* \return \c 0 on success. * \return \c 0 on success.
@ -735,9 +731,8 @@ int mbedtls_cipher_write_tag( mbedtls_cipher_context_t *ctx,
* This must be called after mbedtls_cipher_finish(). * This must be called after mbedtls_cipher_finish().
* *
* \param ctx The generic cipher context. This must be initialized. * \param ctx The generic cipher context. This must be initialized.
* \param tag The buffer holding the tag. If `tag_len > 0`, then this * \param tag The buffer holding the tag. This must be a readable
* must be a readable buffer of at least \p tag_len Bytes, * buffer of at least \p tag_len Bytes.
* otherwise this may be \c NULL.
* \param tag_len The length of the tag to check. * \param tag_len The length of the tag to check.
* *
* \return \c 0 on success. * \return \c 0 on success.
@ -753,14 +748,13 @@ int mbedtls_cipher_check_tag( mbedtls_cipher_context_t *ctx,
* *
* \param ctx The generic cipher context. This must be initialized. * \param ctx The generic cipher context. This must be initialized.
* \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers.
* If `iv_len > 0`, this must be a readable buffer of at * This must be a readable buffer of at least \p iv_len
* least \p iv_len Bytes, otherwise this may be \c NULL. * Bytes.
* \param iv_len The IV length for ciphers with variable-size IV. * \param iv_len The IV length for ciphers with variable-size IV.
* This parameter is discarded by ciphers with fixed-size * This parameter is discarded by ciphers with fixed-size
* IV. * IV.
* \param input The buffer holding the input data. If `ilen > 0`, then * \param input The buffer holding the input data. This must be a
* this must be a readable buffer of at least \p ilen * readable buffer of at least \p ilen Bytes.
* Bytes, otherwise this may be \c NULL.
* \param ilen The length of the input data in Bytes. * \param ilen The length of the input data in Bytes.
* \param output The buffer for the output data. This must be able to * \param output The buffer for the output data. This must be able to
* hold at least `ilen + block_size`. This must not be the * hold at least `ilen + block_size`. This must not be the
@ -797,22 +791,19 @@ int mbedtls_cipher_crypt( mbedtls_cipher_context_t *ctx,
* Bytes. * Bytes.
* \param iv_len The IV length for ciphers with variable-size IV. * \param iv_len The IV length for ciphers with variable-size IV.
* This parameter is discarded by ciphers with fixed-size IV. * This parameter is discarded by ciphers with fixed-size IV.
* \param ad The additional data to authenticate. If `ad_len > 0`, * \param ad The additional data to authenticate. This must be a
* this must be a readable buffer of at least \p ad_len * readable buffer of at least \p ad_len Bytes.
* Bytes, otherwise this may be \c NULL.
* \param ad_len The length of \p ad. * \param ad_len The length of \p ad.
* \param input The buffer holding the input data. If `ilen > 0`, then * \param input The buffer holding the input data. This must be a
* this must be a readable buffer of at least \p ilen * readable buffer of at least \p ilen Bytes.
* Bytes, otherwise this may be \c NULL.
* \param ilen The length of the input data. * \param ilen The length of the input data.
* \param output The buffer for the output data. This must be able to * \param output The buffer for the output data. This must be able to
* hold at least \p ilen Bytes. * hold at least \p ilen Bytes.
* \param olen The length of the output data, to be updated with the * \param olen The length of the output data, to be updated with the
* actual number of Bytes written. This must not be * actual number of Bytes written. This must not be
* \c NULL. * \c NULL.
* \param tag The buffer for the authentication tag. If `tag_len > 0`, * \param tag The buffer for the authentication tag. This must be a
* then this must be a writable buffer of at least * writable buffer of at least \p tag_len Bytes.
* \p tag_len Bytes, otherwise this may be \c NULL.
* \param tag_len The desired length of the authentication tag. * \param tag_len The desired length of the authentication tag.
* *
* \return \c 0 on success. * \return \c 0 on success.
@ -841,22 +832,19 @@ int mbedtls_cipher_auth_encrypt( mbedtls_cipher_context_t *ctx,
* Bytes. * Bytes.
* \param iv_len The IV length for ciphers with variable-size IV. * \param iv_len The IV length for ciphers with variable-size IV.
* This parameter is discarded by ciphers with fixed-size IV. * This parameter is discarded by ciphers with fixed-size IV.
* \param ad The additional data to be authenticated. If `ad_len > 0`, * \param ad The additional data to be authenticated. This must be a
* this must be a readable buffer of at least \p ad_len * readable buffer of at least \p ad_len Bytes.
* Bytes, otherwise this may be \c NULL.
* \param ad_len The length of \p ad. * \param ad_len The length of \p ad.
* \param input The buffer holding the input data. If `ilen > 0`, then * \param input The buffer holding the input data. This must be a
* this must be a readable buffer of at least \p ilen * readable buffer of at least \p ilen Bytes.
* Bytes, otherwise, this may be \c NULL.
* \param ilen The length of the input data. * \param ilen The length of the input data.
* \param output The buffer for the output data. * \param output The buffer for the output data.
* This must be able to hold at least \p ilen Bytes. * This must be able to hold at least \p ilen Bytes.
* \param olen The length of the output data, to be updated with the * \param olen The length of the output data, to be updated with the
* actual number of Bytes written. This must not be * actual number of Bytes written. This must not be
* \c NULL. * \c NULL.
* \param tag The buffer holding the authentication tag. If * \param tag The buffer holding the authentication tag. This must be
* `tag_len > 0`, then this must be a readable buffer of at * a readable buffer of at least \p tag_len Bytes.
* least \p tag_len Bytes, otherwise this can be \c NULL.
* \param tag_len The length of the authentication tag. * \param tag_len The length of the authentication tag.
* *
* \return \c 0 on success. * \return \c 0 on success.