123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #include "sdk_common.h"
- #if NRF_MODULE_ENABLED(NRF_CRYPTO) && \
- NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_NRF_HW_RNG) && \
- !NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG)
- #include "nrf_crypto_rng.h"
- #include "nrf_drv_rng.h"
- ret_code_t nrf_crypto_rng_backend_init(void * const p_context,
- void * const p_temp_buffer)
- {
- ret_code_t ret_val;
-
- UNUSED_PARAMETER(p_context);
- UNUSED_PARAMETER(p_temp_buffer);
- ret_val = nrf_drv_rng_init(NULL);
- return ret_val;
- }
- ret_code_t nrf_crypto_rng_backend_uninit(void * const p_context)
- {
- UNUSED_PARAMETER(p_context);
-
- nrf_drv_rng_uninit();
- return NRF_SUCCESS;
- }
- ret_code_t nrf_crypto_rng_backend_vector_generate(void * const p_context,
- uint8_t * const p_target,
- size_t size,
- bool use_mutex)
- {
- UNUSED_PARAMETER(use_mutex);
- UNUSED_PARAMETER(p_context);
- nrf_drv_rng_block_rand(p_target, size);
- return NRF_SUCCESS;
- }
- ret_code_t nrf_crypto_rng_backend_reseed(void * const p_context,
- void * p_temp_buffer,
- uint8_t * p_input_data,
- size_t size)
- {
- UNUSED_PARAMETER(p_context);
- UNUSED_PARAMETER(p_temp_buffer);
- UNUSED_PARAMETER(p_input_data);
- UNUSED_PARAMETER(size);
-
- return NRF_ERROR_CRYPTO_FEATURE_UNAVAILABLE;
- }
- #endif
|