OpenBSD manual page server

Manual Page Search Parameters

ARC4RANDOM(9) Kernel Developer's Manual ARC4RANDOM(9)

arc4randomkernel random subsystem

#include <dev/rndvar.h>

void
add_true_randomness(int);

void
add_timer_randomness(int);

void
add_mouse_randomness(int);

void
add_tty_randomness(int);

void
add_net_randomness(int);

void
add_disk_randomness(int);

void
add_audio_randomness(int);

u_int32_t
arc4random(void);

void
arc4random_buf(void *buf, size_t nbytes);

u_int32_t
arc4random_uniform(u_int32_t upper_bound);

The (), (), (), () and () routines are used to supply data for the random data source device for further processing. The processing involves calculating inter-event timedelta and measuring entropy contained in the resulting delta-T; the argument data supplied is just mixed into the pool and does not increase the entropy counter.

() does not involve the usual timing calculations, and causes the supplied data argument to be added to the entropy pool, increasing the entropy counter by 32 bits.

() will not cause the entropy counter to rise. It is used to change the state of the pool periodically, mostly by means of timing the random driver's operations.

() and () provide random numbers. They may be called safely in any kernel context.

() will return a uniformly distributed random number less than upper_bound, avoiding "modulo bias" when the upper bound is not a power of two.

arc4random(3), pchb(4), random(4)

January 9, 2011 OpenBSD-5.3