From 295aa36e6036d875f877028cee4ee0a993d851ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Wed, 3 Apr 2024 11:44:10 +0200 Subject: [PATCH] jwt: use sys_rand_get directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use sys_rand_get() directly. Signed-off-by: Fin Maaß --- subsys/jwt/jwt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/subsys/jwt/jwt.c b/subsys/jwt/jwt.c index 0db2426195..a72c85ddc7 100644 --- a/subsys/jwt/jwt.c +++ b/subsys/jwt/jwt.c @@ -255,11 +255,7 @@ static int setup_prng(void) uint8_t entropy[TC_AES_KEY_SIZE + TC_AES_BLOCK_SIZE]; - for (int i = 0; i < sizeof(entropy); i += sizeof(uint32_t)) { - uint32_t rv = sys_rand32_get(); - - memcpy(entropy + i, &rv, sizeof(uint32_t)); - } + sys_rand_get(entropy, sizeof(entropy)); int res = tc_ctr_prng_init(&prng_state, (const uint8_t *) &entropy, sizeof(entropy),