🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.crypt
Article #2971

Re: Wanted: very fast random number generator

#2971
From: Bruce Schneier
Date: Wed, 27 Jan 1993 03:21
19 lines
1496 bytes
In article <C1H7tG.7At.2@cs.cmu.edu> tgl+@cs.cmu.edu (Tom Lane) writes:
>What I need is a very very fast random number generator; it does NOT need to
>be cryptographically strong.  The application is in generating random noise
>for dithering a color image.  I need about 8 random bits on each call
>(randomness of the low order bits is less important than the higher).
>Ideally it would take, say, just a shift and XOR per value.  The code has to
>be portable C, so circular shifts and other non-C operations are out.
>
>I think something along the lines of a shift register with a constant
>pattern XORed in after every shift might solve my problem.  But I don't
>know how to design such a thing.  Info or references would be appreciated.

If you don't need cryptographyically-strong, use the one in Numerical Recipes
in C, page 266 on the bottom.

Just be sure to clock the thing each time you take a bit.  If you need 8 bits,
clock it eight times after you take the 8 low-order bits.

Bruce
Technical Details
Message-ID: <C1HtBI.9ID@chinet.chi.il.us>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!mcdchg!chinet!schneier
References: <C1H7tG.7At.2@cs.cmu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: sci.crypt
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!mcdchg!chinet!schneier
From: schneier@chinet.chi.il.us (Bruce Schneier)
Subject: Re: Wanted: very fast random number generator
Organization: Chinet - Public Access UNIX
Date: Wed, 27 Jan 1993 03:21:15 GMT
Message-ID: <C1HtBI.9ID@chinet.chi.il.us>
References: <C1H7tG.7At.2@cs.cmu.edu>
Lines: 19