Use random_read() for small urandom_read() calls
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 4 Feb 2016 23:33:17 +0000 (18:33 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 4 Feb 2016 23:33:17 +0000 (18:33 -0500)
commit895375801582708d867d15d6bf05eafb7108c6ed
tree47c8a13dae6ad9890e02a97fc5971f5f5cf5a278
parent80584160ee11f8d0047c918564d407489bc959f1
Use random_read() for small urandom_read() calls

urandom_read() starts with a random 8 byte seed.  If we need less than
that, we can (probably) just go with those bytes, as if we called
random_read() directly.

This also exposes random_read() and urandom_read() to external callers.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/random.c
kern/include/ns.h