The Leopard-15/L15 CSPRNG (Cryptographically Secure Pseudo Random Number Generator) was developed to rectify the shortcomings of the well-known ARC4 algorithm (on which it is based).

L15 is a simple and fast algorithm which passes the DIEHARD randomness test-suite.

L15 is used as the generator for the /dev/urandom pseudo-device in the DragonFlyBSD operating system.

L15 Algorithm Summary


The L15 algorithm:

L15.h (The L15 Algorithm; C++ header)

Note: The above source-code requires that the "unsigned char" type is exactly eight bits in size and that increment/decrement operations wrap.
Note: The above 256-term internal-state version of L15 has a guaranteed minimum cycle-length of 65536 (original ARC4 was 256).

L15P.h (Portable L15 Algorithm; C++ header)

Note: The above source-code is portable and allows the size of the internal-state to be altered from the default size of 256.


Copyright © 2003-2012 Robin Carey.
All rights reserved.