mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Add initializers for input / output copies
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@ -520,6 +520,8 @@ typedef struct psa_crypto_input_copy_s {
|
|||||||
size_t len;
|
size_t len;
|
||||||
} psa_crypto_input_copy_t;
|
} psa_crypto_input_copy_t;
|
||||||
|
|
||||||
|
#define PSA_CRYPTO_INPUT_COPY_INIT { NULL, 0 }
|
||||||
|
|
||||||
/** Allocate a local copy of an input buffer.
|
/** Allocate a local copy of an input buffer.
|
||||||
*
|
*
|
||||||
* \param[in] input Pointer to input buffer.
|
* \param[in] input Pointer to input buffer.
|
||||||
@ -548,6 +550,8 @@ typedef struct psa_crypto_output_copy_s {
|
|||||||
size_t len;
|
size_t len;
|
||||||
} psa_crypto_output_copy_t;
|
} psa_crypto_output_copy_t;
|
||||||
|
|
||||||
|
#define PSA_CRYPTO_OUTPUT_COPY_INIT { NULL, NULL, 0 }
|
||||||
|
|
||||||
/** Allocate a local copy of an output buffer.
|
/** Allocate a local copy of an output buffer.
|
||||||
*
|
*
|
||||||
* \note This does not copy any data from the original
|
* \note This does not copy any data from the original
|
||||||
|
@ -184,12 +184,9 @@ void output_copy_free(int output_len, int original_is_null,
|
|||||||
{
|
{
|
||||||
uint8_t *output = NULL;
|
uint8_t *output = NULL;
|
||||||
uint8_t *buffer_copy_for_comparison = NULL;
|
uint8_t *buffer_copy_for_comparison = NULL;
|
||||||
psa_crypto_output_copy_t output_copy;
|
psa_crypto_output_copy_t output_copy = PSA_CRYPTO_OUTPUT_COPY_INIT;
|
||||||
psa_status_t status;
|
psa_status_t status;
|
||||||
|
|
||||||
output_copy.buffer = NULL;
|
|
||||||
output_copy.len = 0;
|
|
||||||
|
|
||||||
if (!original_is_null) {
|
if (!original_is_null) {
|
||||||
TEST_CALLOC(output, output_len);
|
TEST_CALLOC(output, output_len);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user