mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
sys/random: shaxprng init use digest not state
This commit is contained in:
parent
7232c5291d
commit
0b48298d95
@ -152,8 +152,8 @@ void random_init_by_array(uint32_t init_key[], int key_length)
|
|||||||
_shax_update(&ctx, init_key, key_length);
|
_shax_update(&ctx, init_key, key_length);
|
||||||
_shax_final(&ctx, digestdata);
|
_shax_final(&ctx, digestdata);
|
||||||
|
|
||||||
/* copy seeded SHA1 state to PRNG state */
|
/* copy SHA digestdata to PRNG state */
|
||||||
memcpy(prng_state, &ctx.state, STATE_SIZE);
|
memcpy(prng_state, digestdata, STATE_SIZE);
|
||||||
|
|
||||||
/* reset position indicator */
|
/* reset position indicator */
|
||||||
datapos = STATE_SIZE;
|
datapos = STATE_SIZE;
|
||||||
|
Loading…
Reference in New Issue
Block a user