1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Rename "output_copy" -> "local_output"

This helps to prevent confusion as it avoids overloading the word
"copy" as both an action and an object.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann
2023-11-20 12:54:09 +00:00
parent f1734054fa
commit 89875a4f20
4 changed files with 76 additions and 76 deletions

View File

@ -883,13 +883,13 @@ psa_status_t psa_crypto_local_input_alloc(const uint8_t *input, size_t input_len
*/
void psa_crypto_local_input_free(psa_crypto_local_input_t *local_input);
typedef struct psa_crypto_output_copy_s {
typedef struct psa_crypto_local_output_s {
uint8_t *original;
uint8_t *buffer;
size_t length;
} psa_crypto_output_copy_t;
} psa_crypto_local_output_t;
#define PSA_CRYPTO_OUTPUT_COPY_INIT { NULL, NULL, 0 }
#define PSA_CRYPTO_LOCAL_OUTPUT_INIT { NULL, NULL, 0 }
/** Allocate a local copy of an output buffer.
*
@ -897,31 +897,31 @@ typedef struct psa_crypto_output_copy_s {
* output buffer but only allocates a buffer
* whose contents will be copied back to the
* original in a future call to
* psa_crypto_output_copy_free().
* psa_crypto_local_output_free().
*
* \param[in] output Pointer to output buffer.
* \param[in] output_len Length of the output buffer.
* \param[out] output_copy Pointer to a psa_crypto_output_copy_t struct to
* populate with the output copy.
* \param[out] local_output Pointer to a psa_crypto_local_output_t struct to
* populate with the local output copy.
* \return #PSA_SUCCESS, if the buffer was successfully
* copied.
* \return #PSA_ERROR_INSUFFICIENT_MEMORY, if a copy of
* the buffer cannot be allocated.
*/
psa_status_t psa_crypto_output_copy_alloc(uint8_t *output, size_t output_len,
psa_crypto_output_copy_t *output_copy);
psa_status_t psa_crypto_local_output_alloc(uint8_t *output, size_t output_len,
psa_crypto_local_output_t *local_output);
/** Copy from a local copy of an output buffer back to the original, then
* free the local copy.
*
* \param[in] output_copy Pointer to a psa_crypto_output_copy_t struct
* \param[in] local_output Pointer to a psa_crypto_local_output_t struct
* populated by a previous call to
* psa_crypto_output_copy_alloc().
* \return #PSA_SUCCESS, if the output copy was
* psa_crypto_local_output_alloc().
* \return #PSA_SUCCESS, if the local output was
* successfully copied back to the original.
* \return #PSA_ERROR_CORRUPTION_DETECTED, if the output
* could not be copied back to the original.
*/
psa_status_t psa_crypto_output_copy_free(psa_crypto_output_copy_t *output_copy);
psa_status_t psa_crypto_local_output_free(psa_crypto_local_output_t *local_output);
#endif /* PSA_CRYPTO_CORE_H */