Abstract
Random numbers are used in a variety of applications including simulation, sampling, and cryptography. Fortunately, there exist many well-established methods of random number generation. An example of a well-known pseudorandom number generator is the lagged-Fibonacci generator (LFG). Marsaglia showed that the lagged-Fibonacci generator using addition failed some of his DIEHARD statistical tests, while it passed all when longer lags were used. This paper presents a scrambler that takes bits from a pseudorandom number generator and outputs (hopefully) improved pseudorandom numbers. The scrambler is based on a modified Feistel function, a method used in the generation of cryptographic random numbers, and multiplication by a chosen multiplier. We show that this scrambler improves the quality of pseudorandom numbers by applying it to the additive LFG with small lags. The scrambler performs well based on its performance with the TestU01 suite of randomness tests.[1] The scrambling of the LFG is so successful that scrambled LFGs with small lags perform as well as unscrambled LFGs with long lags. This comes at the cost of a doubling of execution time, and provides users with generators with small memory footprints that can provide parallel generators like the LFGs in the SPRNG parallel random number generation package.
Dedicated to the memory of our colleague, Dr. John Salmon. John introduced the scrambling of pseudorandom numbers in his SC’11 paper [21], and even used the Feistel scrambler with the Random123 package introduced in that paper. Sadly, John died of a heart attack at his home in the New York Hudson Valley on October 27, 2021.
Funding statement: The first author would like to thank the Saudi Arabian Cultural Mission (SACM) and Princess Nourah bint Abdulrahman University (PNU) for the scholarship and the support during this research.
References
[1] A. Aljahdali and M. Mascagni, Feistel-inspired scrambling improves the quality of linear congruential generators, Monte Carlo Methods Appl. 23 (2017), no. 2, 89–99. 10.1515/mcma-2017-0105Search in Google Scholar
[2] L. E. Bassham, III, A. L. Rukhin, J. Soto, J. R. Nechvatal, M. E. Smid, E. B. Barker, S. D. Leigh, M. Levenson, M. Vangel, D. L. Banks, Sp 800-22 rev. 1a. a statistical test suite for random and pseudorandom number generators for cryptographic applications, 2010. 10.6028/NIST.SP.800-22r1aSearch in Google Scholar
[3] C. Bays and S. Durham, Improving a poor random number generator, ACM Trans. Math. Software 2 (1976), no. 1, 59–64. 10.1145/355666.355670Search in Google Scholar
[4] D. Blackman and S. Vigna, Scrambled linear pseudorandom number generators, ACM Trans. Math. Software 47 (2021), no. 4, Article ID 36. 10.1145/3460772Search in Google Scholar
[5] U. Blumenthal and S. M. Bellovin, A better key schedule for des-like ciphers, 1996. Search in Google Scholar
[6] J. Katz and Y. Lindell, Introduction to Modern Cryptography, Chapman and Hall/CRC, Boca Raton, 2014. 10.1201/b17668Search in Google Scholar
[7] D. E. Knuth, Art of Computer Programming. Volume 2: Seminumerical Algorithms, Addison-Wesley, Reading, 2014. Search in Google Scholar
[8] P. L’Ecuyer, Random numbers for simulation, Commun. ACM 33 (1990), no. 10, 85–97. 10.1145/84537.84555Search in Google Scholar
[9] P. L’Ecuyer, Random number generation, Handbook of Computational Statistics, Springer Handb. Comput. Stat., Springer, Heidelberg (2012), 35–71. 10.1007/978-3-642-21551-3_3Search in Google Scholar
[10] P. L’Ecuyer and R. Simard, Testu01: Ac library for empirical testing of random number generators, ACM Trans. Math. Software 33 (2007), no. 4, Article ID 22. 10.1145/1268776.1268777Search in Google Scholar
[11] M. D. MacLaren and G. Marsaglia, Uniform random number generators, J. ACM 12 (1965), no. 1, 83–89. 10.21236/AD0602671Search in Google Scholar
[12] G. Marsaglia, A current view of random number generators, Computer Science and Statistics, Sixteenth Symposium on the Interface, Elsevier, Amsterdam (1985), 3–10. Search in Google Scholar
[13] G. Marsaglia, Diehard: A battery of tests of randomness, (1996), http://stat.␣fsu.␣edu/geo/diehard.␣html. Search in Google Scholar
[14] M. Mascagni, S. A. Cuccaro, D. V. Pryor and M. L. Robinson, A fast, high quality, and reproducible parallel lagged-Fibonacci pseudorandom number generator, J. Comput. Phys. 119 (1995), no. 2, 211–219. 10.1006/jcph.1995.1130Search in Google Scholar
[15] M. Mascagni and A. Srinivasan, Algorithm 806: Sprng: A scalable library for pseudorandom number generation, ACM Trans. Math. Software 26 (2000), no. 3, 436–461. 10.1145/358407.358427Search in Google Scholar
[16] M. Matsumoto, I. Wada, A. Kuramoto and H. Ashihara, Common defects in initialization of pseudorandom number generators, ACM Trans. Math. Software 17 (2007), no. 4, Article ID 15. 10.1145/1276927.1276928Search in Google Scholar
[17] A. J. Menezes, S. A. Vanstone and P. C. Van Oorschot, Handbook of Applied Cryptography, CRC Press, Boca Raton, 1996. Search in Google Scholar
[18] M. E. O’Neill, Pcg: A family of simple fast space-efficient statistically good algorithms for random number generation, Technical Report HMC-CS-2014-0905, Harvey Mudd College, Claremont, 2014. Search in Google Scholar
[19] V. Pareek, An overview of cryptographically secure pseudorandom number generators and bbs, Int. J. Comput. Appl. (2014),0975–8887. Search in Google Scholar
[20] M. Saito and M. Matsumoto, Xsadd (version 1.1).(25 march 2014), 2014. Search in Google Scholar
[21] J. K. Salmon, M. A. Moraes, R. O. Dror and D. E. Shaw, Parallel random numbers: As easy as 1, 2, 3, Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis, IEEE Press, Piscataway (2011), 1–12. 10.1145/2063384.2063405Search in Google Scholar
[22] A. Shamir, On the generation of cryptographically strong pseudo-random sequences, International Colloquium on Automata, Languages, and Programming, Lecture Notes in Comput. Sci. 115, Springer, New York (1981), 544–550. 10.1007/3-540-10843-2_43Search in Google Scholar
[23] G. L. Steele, Jr., D. Lea and C. H. Flood, Fast splittable pseudorandom number generators, ACM SIGPLAN Notices 49 (2014), no. 10, 453–472. 10.1145/2714064.2660195Search in Google Scholar
[24] S. Vigna, An experimental exploration of marsaglia’s xorshift generators, scrambled, ACM Trans. Math. Softw. 42 (2016), no. 4, 1–23. 10.1145/2845077Search in Google Scholar
[25] Data Encryption Standard, Federal information processing standards publication 46, National Bureau of Standards, US Department of Commerce, 23, 1977. Search in Google Scholar
© 2022 Walter de Gruyter GmbH, Berlin/Boston