lightning-kmp
lightning-kmp copied to clipboard
Add secondary pseudo-random number generator
In case of catastrophic failures of the OS SecureRandom
instance, we add a secondary randomness source that we mix into the random stream.
This is a somewhat weak random source and should not be used on its own, but it doesn't hurt to xor it with the output of SecureRandom
.
The runtimeEntropy
should be customized for iOS and Android by fetching all kind of random noise available to the application (available memory, process ID, sensor data, network statistics, etc).
Thanks @robbiehanson for the iOS code!