From 8978f5c32a2f09fff67746a6f08d2f31a9034ee8 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Mon, 30 Oct 2023 20:37:12 +0000 Subject: [PATCH] Add implementation of psa_crypto_copy_output() Signed-off-by: David Horstmann --- library/psa_crypto.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 33040faf69..56f02a9b41 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -8454,4 +8454,14 @@ psa_status_t psa_crypto_copy_input(const uint8_t *input, size_t input_len, return PSA_SUCCESS; } +psa_status_t psa_crypto_copy_output(const uint8_t *output_copy, size_t output_copy_len, + uint8_t *output, size_t output_len) +{ + if (output_len < output_copy_len) { + return PSA_ERROR_BUFFER_TOO_SMALL; + } + memcpy(output, output_copy, output_copy_len); + return PSA_SUCCESS; +} + #endif /* MBEDTLS_PSA_CRYPTO_C */