home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / sci / crypt / 7178 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.4 KB  |  30 lines

  1. Newsgroups: sci.crypt
  2. Path: 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
  3. From: schneier@chinet.chi.il.us (Bruce Schneier)
  4. Subject: Re: Wanted: very fast random number generator
  5. Organization: Chinet - Public Access UNIX
  6. Date: Wed, 27 Jan 1993 03:21:15 GMT
  7. Message-ID: <C1HtBI.9ID@chinet.chi.il.us>
  8. References: <C1H7tG.7At.2@cs.cmu.edu>
  9. Lines: 19
  10.  
  11. In article <C1H7tG.7At.2@cs.cmu.edu> tgl+@cs.cmu.edu (Tom Lane) writes:
  12. >What I need is a very very fast random number generator; it does NOT need to
  13. >be cryptographically strong.  The application is in generating random noise
  14. >for dithering a color image.  I need about 8 random bits on each call
  15. >(randomness of the low order bits is less important than the higher).
  16. >Ideally it would take, say, just a shift and XOR per value.  The code has to
  17. >be portable C, so circular shifts and other non-C operations are out.
  18. >
  19. >I think something along the lines of a shift register with a constant
  20. >pattern XORed in after every shift might solve my problem.  But I don't
  21. >know how to design such a thing.  Info or references would be appreciated.
  22.  
  23. If you don't need cryptographyically-strong, use the one in Numerical Recipes
  24. in C, page 266 on the bottom.
  25.  
  26. Just be sure to clock the thing each time you take a bit.  If you need 8 bits,
  27. clock it eight times after you take the 8 low-order bits.
  28.  
  29. Bruce
  30.