|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Mbed TLS PSA random-source adapter for the HTTPS client demo. More...
#include <stddef.h>#include <stdint.h>#include "ra8_check.h"#include "ra8_err.h"#include "ra8_rsip.h"#include "psa/crypto.h"Go to the source code of this file.
Functions | |
| psa_status_t | mbedtls_psa_external_get_random (mbedtls_psa_external_random_context_t *context, uint8_t *output, size_t output_size, size_t *output_length) |
| PSA external RNG hook – feeds RSIP TRNG straight into PSA. | |
Mbed TLS PSA random-source adapter for the HTTPS client demo.
Implements the Mbed TLS external PSA random callback using the RA8D2 RSIP true-random generator. Keeping the vendor callback in its own translation unit isolates the TLS adaptation boundary from the ThreadX and HTTP session orchestration in main.c.
Definition in file mbedtls_psa_rng.c.
| psa_status_t mbedtls_psa_external_get_random | ( | mbedtls_psa_external_random_context_t * | context, |
| uint8_t * | output, | ||
| size_t | output_size, | ||
| size_t * | output_length ) |
PSA external RNG hook – feeds RSIP TRNG straight into PSA.
Mbed TLS 4.x removed MBEDTLS_ENTROPY_C / MBEDTLS_CTR_DRBG_C from the standard build path. With MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG the SSL layer pulls random bytes from this callback (via psa_generate_random) instead of running an in-tree DRBG.
| [in,out] | context | PSA's per-process external RNG context (unused). |
| [out] | output | Output buffer. |
| [in] | output_size | Bytes requested. |
| [out] | output_length | Bytes actually produced. |
| PSA_SUCCESS | Exactly output_size random bytes were produced. |
| PSA_ERROR_INVALID_ARGUMENT | An output pointer is null. |
| PSA_ERROR_HARDWARE_FAILURE | The RSIP TRNG returned an error. |
output and output_length are non-null caller-owned storage. output contains output_size bytes from the RSIP TRNG. output_length equals output_size. Definition at line 54 of file mbedtls_psa_rng.c.
References k_ra8_ok, RA8_CHECK_NULL_PTR_RETURN, and ra8_rsip_trng_read().