Skip to content

Commit

Permalink
rng: allow testing with unsafe rng
Browse files Browse the repository at this point in the history
  • Loading branch information
arturkow2000 committed Apr 2, 2024
1 parent bdcdb15 commit a7b6489
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a7b6489

Please sign in to comment.