]> git.karo-electronics.de Git - karo-tx-linux.git/commit
prandom: introduce prandom_bytes() and prandom_bytes_state()
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 29 Nov 2012 03:19:11 +0000 (14:19 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:23:54 +0000 (16:23 +1100)
commit6233681d05437e33c27183c1eff14ae1a14db2a3
tree310a49e2fd6f39c1c70cbdf601233bb4dec4484e
parent11452cff9711d4094f7aa2744fa5b5983eca6beb
prandom: introduce prandom_bytes() and prandom_bytes_state()

Add functions to get the requested number of pseudo-random bytes.

The difference from get_random_bytes() is that it generates pseudo-random
numbers by prandom_u32().  It doesn't consume the entropy pool, and the
sequence is reproducible if the same rnd_state is used.  So it is suitable
for generating random bytes for testing.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: David Laight <david.laight@aculab.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Robert Love <robert.w.love@intel.com>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/random.h
lib/random32.c