From 0b48298d95908745697c4400c9a6df014646b50f Mon Sep 17 00:00:00 2001 From: PeterKietzmann Date: Fri, 10 Jul 2020 14:30:24 +0200 Subject: [PATCH] sys/random: shaxprng init use digest not state --- sys/random/shaxprng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/random/shaxprng.c b/sys/random/shaxprng.c index 271575d874..dfbe01e2f9 100644 --- a/sys/random/shaxprng.c +++ b/sys/random/shaxprng.c @@ -152,8 +152,8 @@ void random_init_by_array(uint32_t init_key[], int key_length) _shax_update(&ctx, init_key, key_length); _shax_final(&ctx, digestdata); - /* copy seeded SHA1 state to PRNG state */ - memcpy(prng_state, &ctx.state, STATE_SIZE); + /* copy SHA digestdata to PRNG state */ + memcpy(prng_state, digestdata, STATE_SIZE); /* reset position indicator */ datapos = STATE_SIZE;