HI @withthegrid
trng is a True Random Number Generator, and is used to seed the DRBG. It is not recommended to use directly the trng, as it may be biased.
I would suggest you use Mbed Crypto DRBG API, as shown in the example:
static void generate_a_random_value(void)
{
psa_status_t status;
uint8_t random[10] = { 0 };
printf("Generate random...\t");
fflush(stdout);
/* Initialize PSA Crypto */
status = psa_crypto_init();
if (status != PSA_SUCCESS) {
printf("Failed to initialize PSA Crypto\n");
return;
}
status = psa_generate_random(random, sizeof(random));
if (status != PSA_SUCCESS) {
printf("Failed to generate a random value\n");
return;
}
printf("Generated random data\n");
/* Clean up */
mbedtls_psa_crypto_free();
}
Regards,
Mbed Support
Ron