From a7b6489aab391cd86bdb515ad1dbdad9e2561b6c Mon Sep 17 00:00:00 2001 From: Artur Kowalski Date: Tue, 2 Apr 2024 13:06:11 +0200 Subject: [PATCH] rng: allow testing with unsafe rng --- app/src/rng.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/rng.c b/app/src/rng.c index 2f43ac6..a009854 100644 --- a/app/src/rng.c +++ b/app/src/rng.c @@ -9,7 +9,12 @@ static uint8_t buffer[64]; char buffer_ascii[sizeof buffer * 2 + 1]; static int rng_test(const struct shell *sh) { +#if CONFIG_TWPM_USE_UNSAFE_RNG + sys_rand_get(buffer, sizeof buffer); + int ret = 0; +#else int ret = sys_csrand_get(buffer, sizeof buffer); +#endif if (ret == 0) { for (int i = 0; i < sizeof buffer; i++) { uint8_t t;