mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Add MBEDTLS_PSA_COPY_CALLER_BUFFERS config option
This allows us to entirely remove copying code, where the convenience macros are used for copying. Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@ -106,6 +106,7 @@ mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state =
|
||||
if (global_data.initialized == 0) \
|
||||
return PSA_ERROR_BAD_STATE;
|
||||
|
||||
#if defined(MBEDTLS_PSA_COPY_CALLER_BUFFERS)
|
||||
/* Substitute an input buffer for a local copy of itself.
|
||||
* Assumptions:
|
||||
* - psa_status_t status exists
|
||||
@ -143,6 +144,12 @@ mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state =
|
||||
if (local_output_free_status != PSA_SUCCESS) { \
|
||||
status = local_output_free_status; \
|
||||
}
|
||||
#else /* MBEDTLS_PSA_COPY_CALLER_BUFFERS */
|
||||
#define SWAP_FOR_LOCAL_INPUT(input, length)
|
||||
#define FREE_LOCAL_INPUT(input)
|
||||
#define SWAP_FOR_LOCAL_OUTPUT(output, length)
|
||||
#define FREE_LOCAL_OUTPUT(output)
|
||||
#endif /* MBEDTLS_PSA_COPY_CALLER_BUFFERS */
|
||||
|
||||
psa_status_t mbedtls_to_psa_error(int ret)
|
||||
{
|
||||
|
Reference in New Issue
Block a user