Skip to content
Commit 4400540d authored by Artur Hadasz's avatar Artur Hadasz Committed by Fabio Baltieri
Browse files

modules: hal_nordic: nrf_802154: RNG xor-shift algorithm



The LCG method used earlier in the random number generator was problematic,
as the lowest bits repeated periodically (for example, the generated number
always resulted in an odd-even-odd-even-.. sequence, or the last three bits
formed an cycle of the length 8). This is because the LCG was done module
2^32. Any LCG using a power of 2 as the modulus will cause the same issue.
The used RNG method was changed to Marsaglia's xor shift-algorithm,
which does not have this issue.

Signed-off-by: default avatarArtur Hadasz <artur.hadasz@nordicsemi.no>
parent 24f2c306
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment