From 957f9803793f4e02e5be95b7ea5b69a1ad8474c5 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Mon, 30 Oct 2023 20:29:43 +0000 Subject: [PATCH] Add implementation of psa_crypto_copy_input() Signed-off-by: David Horstmann --- library/psa_crypto.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index e4b865ec97..a8ef564cd7 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -5523,4 +5523,16 @@ exit: return status; } +psa_status_t psa_crypto_copy_input(const uint8_t *input, size_t input_len, + uint8_t *input_copy, size_t input_copy_len) +{ + if (input_len > input_copy_len) { + return PSA_ERROR_BUFFER_TOO_SMALL; + } + + memcpy(input_copy, input, input_len); + + return PSA_SUCCESS; +} + #endif /* MBEDTLS_PSA_CRYPTO_C */