MirBSD manpage: add_auvis_randomness(9), add_disk_randomness(9), add_imacs_randomness(9), add_mouse_randomness(9), add_net_randomness(9), add_timer_randomness(9), add_true_randomness(9), add_tty_randomness(9), arc4random(9), get_random_bytes(9), random(9)

RND(9)                        BSD Kernel Manual                         RND(9)

NAME

     random - device kernel interface

SYNOPSIS

     #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);

DESCRIPTION

     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.

SEE ALSO

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

CAVEATS

     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 MirBSD #11.

MirBSD #10-current               July 9, 2011                                1

Generated on 2022-12-24 01:00:14 by $MirOS: src/scripts/roff2htm,v 1.113 2022/12/21 23:14:31 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2022 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.

Kontakt / Impressum & Datenschutzerklärung