Sujet : Re: KISS 64-bit pseudo-random number generator
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 09. Sep 2024, 09:55:14
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2024Sep9.105514@mips.complang.tuwien.ac.at>
References : 1 2 3
User-Agent : xrn 10.11
mhx@iae.nl (mhx) writes:
On Mon, 9 Sep 2024 6:55:49 +0000, Lars Brinkhoff wrote:
>
[..]
I would like to recommend Marsaglia's newer and better xorshift family
of PRNGs, and preferably the further development by Sebastiano Vigna
called xoroshiro. The output (with suitable parameters) is very good*,
yet the implementation is very simple.
>
*But not cryptography grade.
>
Being "cryptography grade" is the point when you want to introduce
something new for a PRNG :--)
Having better randomness at the same speed or better speed with
similar randomness is also relevant outside cryptographic
applications.
1320>> : RANDOM seed $107465 * $234567 + ( -- u )
1321: 9 ROL DUP TO seed ;
So this is a linear congruential generator enhanded with the 9 ROL.
LCGs have known weaknesses that are relevant even for
non-cryptographic applications. Maybe the ROL fixes those; have you
run it through ransomness testers?
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/ EuroForth 2024: https://euro.theforth.net