diff options
author | Linus Nordberg <linus@nordberg.se> | 2019-12-18 23:36:25 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2020-01-21 16:07:56 +0100 |
commit | 76a6b631f4bd6866622f537870bc145c935bef40 (patch) | |
tree | e5120a2cbfb18deeca95c6670dfd3216745d4d8c /src/entropy | |
parent | 41eb060367b91415aadea26f63efc3db8fdbc92b (diff) |
[cc20rng] Revamping the ChaCha20 seeding
- chacha20_prng_block() uses counter in the state struct
- chacha20_setup() replaces chacha20_prng_reseed() and fills the whole
state struct, fixing a bug where only half of the key was being set;
as a result of 'counter' being set, a state struct filled with
entropy from the TRNG makes reseeding occur after a random number of
rounds instead of after a fixed 2^32-1 rounds
- decrementing of the block counter is done in chacha20_prng_block()
- chacha output is copied to buf _after_ the interrupt driven
transmission of buf to UART has finished, to stop the race between
reading and refilling of buf
Diffstat (limited to 'src/entropy')
0 files changed, 0 insertions, 0 deletions