Lorenzo dixit: > Wait, wait - 1. MirBSD?
Of course. > 2. what did you measure exactly? Nothing, I just saw the comparative measurements in the paper. > Are you considering RS14 for /dev/random? Of course not. Just for both /dev/arandom and userspace arc4random(). > Making a portable arc4random() No, I don’t do that because other operating systems don’t provide sensible enough kernel interfaces. The closest one is OpenBSD, but even theirs suck. > based on RS14 should be more than good enough for the portable > version of mksh, even in terms of speed - or did you stop using > arc4random() for $RANDOM because of this slow machines? No, mksh’s $RANDOM does not need arc4random() and does not promise it – I just use it when it’s convenient. I don’t use it on most OSes because almost all OSes don’t provide good and easy to use kernel interfaces to gather entropy, and I’d rather not have several fall‐ back mechanisms. > Ie slowing down rndget() by a factor X has an impact which is much smaller > than > X due to the shell having to parse over and over, not to mention that in real > usage you'd actually be doing something other than generating random > numbers... We need to separate several concerns here: • do we use arc4random() for mksh, or rather, when • what provides arc4random() • arc4random() on MirBSD may or may not be using Spritz, it currently uses aRC4 • arc4random() on OpenBSD used aRC4 and uses ChaCha20 now, but lacks an interface to push back entropy to the kernel • arc4random() is not native to any other OS, and all portable implementations suck, both in themselves and because of their underlying operating systems (e.g. Linux deprecating sysctl(), and their new proposed getentropy syscall (incompatible to OpenBSD’s new one) sucks) • what do we do in mksh if an OS absolutely cannot support arc4random() (e.g. lack of /dev/urandom and similar) The last point is actually why I’d say, we only use arc4random() if “it’s there anyway”, which is basically OpenBSD and MirBSD “period”. Everything else gets an LCG, and I’m seriously considering removing all overhead and just using dumb mode there (that can also easily be tested for). (And OpenBSD just doesn’t get the kernel feedback, period. They asked for them to not get it, even.) bye, //mirabilos -- 22:20⎜<asarch> The crazy that persists in his craziness becomes a master 22:21⎜<asarch> And the distance between the craziness and geniality is only measured by the success 18:35⎜<asarch> "Psychotics are consistently inconsistent. The essence of sanity is to be inconsistently inconsistent
