1 /* 2 * Copyright (c) 2019-2022, Arm Limited. All rights reserved. 3 * Copyright (c) 2021, Nordic Semiconductor ASA. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 * 7 */ 8 9 #include <stddef.h> 10 #include <stdint.h> 11 12 #include "config_crypto.h" 13 #include "tfm_mbedcrypto_include.h" 14 15 #include "tfm_crypto_api.h" 16 #include "tfm_crypto_defs.h" 17 18 /*! 19 * \addtogroup tfm_crypto_api_shim_layer 20 * 21 */ 22 23 /*!@{*/ tfm_crypto_random_interface(psa_invec in_vec[],psa_outvec out_vec[])24psa_status_t tfm_crypto_random_interface(psa_invec in_vec[], 25 psa_outvec out_vec[]) 26 { 27 #if !CRYPTO_RNG_MODULE_ENABLED 28 (void)in_vec; 29 (void)out_vec; 30 31 return PSA_ERROR_NOT_SUPPORTED; 32 #else 33 uint8_t *output = out_vec[0].base; 34 size_t output_size = out_vec[0].len; 35 36 return psa_generate_random(output, output_size); 37 #endif 38 } 39 /*!@}*/ 40