RND(9) BSD Kernel Manual RND(9)
random - device kernel interface
#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_disk_randomness(int); void add_net_randomness(int); void add_auvis_randomness(int); void add_imacs_randomness(int); void get_random_bytes(void *buf, size_t nbytes); u_int32_t arc4random(void); void arc4random_buf(void *buf, size_t len); uint32_t arc4random_uniform(uint32_t upper_bound); void rnd_lopool_add(const void *buf, size_t len); void rnd_lopool_addh(const void *buf, size_t len); void rnd_lopool_addv(unsigned long);
The add_mouse_randomness(), add_tty_randomness(), add_net_randomness(), add_disk_randomness(), add_auvis_randomness(), and add_imacs_randomness() routines are used to supply data for the random data source device for further processing. The processing involves calculating inter-event time delta and measuring entropy contained in the resulting delta-T; the argu- ment data supplied is just mixed into the pool and does not increase the entropy counter. add_true_randomness() does not involve the usual timing calculations, and causes the supplied data argument to be added to the entropy pool, in- creasing the entropy counter by 32 bits. add_timer_randomness() 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. get_random_bytes() may be used to retrieve strong random data, just as it would by the srandom(4) device. arc4random() will give random 32 bit numbers hashed with the ARC4 algo- rithm, which appears to be faster and less abusive to the entropy pool. arc4random_buf() will fill a buffer with bytes from the same source. arc4random_uniform() will give the result of arc4random() modulo upper_bound, except the result is uniformly distributed across the result value space. rnd_lopool_add() will add bytes from wrandom(4) and other "untrusted" sources via two temporary pools, one using the one-at-a-time hash, the other using the arcfour stream cipher, into the arc4random pool. rnd_lopool_addh() will hash the input into a 32-bit number first, and rnd_lopool_addv() takes an integral argument instead of a buffer.
arc4random(3), pchb(4), random(4)
None of these functions should really be called during the autoconf(4) process. Calling the three arc4random and the three rnd_lopool_add func- tions however is safe at any time since MirOS #11. MirOS BSD #10-current July 9, 2011 1
Generated on 2016-04-09 18:24:16 by $MirOS: src/scripts/roff2htm,v 1.83 2016/03/26 23:38:28 tg Exp $
These manual pages and other documentation are copyrighted by their respective writers;
their source is available at our CVSweb,
AnonCVS, and other mirrors. The rest is Copyright © 2002–2016 The MirOS Project, Germany.
This product includes material provided by mirabilos.
This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.