aboutsummaryrefslogtreecommitdiff
path: root/win32/sh_random.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix for old mingw-w64 (32-bit)Ron Yorston2023-06-151-0/+3
| | | | | | It appears that RtlGenRandom() wasn't supported in 32-bit builds using mingw-w64 until version 7.0.0 (Fedora 33). Use the time to initialise the PRNG in earlier versions.
* win32: improve seeding of PRNGsRon Yorston2023-01-111-24/+4
| | | | | | | | | | | | | | | | | busybox-w32 provides two PRNG implementations which are used in the emulation of /dev/urandom. The ad hoc method of seeding them has been replaced by calls to RtlGenRandom. The documentation for RtlGenRandom indicates it has been deprecated in favour of CryptGenRandom. The documentation for the latter indicates it has been deprecated in favour of the 'Cryptography Next Generation APIs'. Nonetheless, RtlGenRandom remains available in every version of Windows since XP. In the unlikely event that RtlGenRandom fails simply use the current time as the seed. Saves 192 bytes in the default configuration.
* win32: code shrinkRon Yorston2021-08-081-3/+3
| | | | | | | | | Save a few bytes: - When collecting entropy prefer functions we call elsewhere. - In uname(2) set 32-bit processor type to i686 and tweak it for i386.
* win32: allow use of shell's PRNG for /dev/urandomRon Yorston2018-03-221-0/+76
Allow either ISAAC or the shell's built-in pseudo-random number generator to be used for /dev/urandom. The latter is smaller so it's the default.