mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Allow some parameters to be NULL if the length is 0.
This change permits users of the ChaCha20/Poly1305 algorithms (and the AEAD construction thereof) to pass NULL pointers for data that they do not need, and avoids the need to provide a valid buffer for data that is not used.
This commit is contained in:
parent
b8025c5826
commit
a310c5e42b
6 changed files with 33 additions and 4 deletions
|
|
@ -136,7 +136,9 @@ int mbedtls_chacha20_keystream_block( const mbedtls_chacha20_context *ctx,
|
|||
* \param ctx The ChaCha20 context.
|
||||
* \param size The length (in bytes) to process. This can have any length.
|
||||
* \param input Buffer containing the input data.
|
||||
* This pointer can be NULL if size == 0.
|
||||
* \param output Buffer containing the output data.
|
||||
* This pointer can be NULL if size == 0.
|
||||
*
|
||||
* \return MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if the ctx, input, or
|
||||
* output pointers are NULL.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue