summaryrefslogtreecommitdiffstats
path: root/share/man/man9/random_harvest.9
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-03-18 16:52:32 +0000
committerru <ru@FreeBSD.org>2002-03-18 16:52:32 +0000
commitd9a2dd6fcd7f2734b222ef7ce0d5c35dcf169ba3 (patch)
tree19f0281fdbecd88b21c183403487b46fb44aa5a6 /share/man/man9/random_harvest.9
parente75296ea44cc16a1fce7e5b0d68688f9825f49dd (diff)
downloadFreeBSD-src-d9a2dd6fcd7f2734b222ef7ce0d5c35dcf169ba3.zip
FreeBSD-src-d9a2dd6fcd7f2734b222ef7ce0d5c35dcf169ba3.tar.gz
mdoc(7) police: tidy up.
Diffstat (limited to 'share/man/man9/random_harvest.9')
-rw-r--r--share/man/man9/random_harvest.965
1 files changed, 37 insertions, 28 deletions
diff --git a/share/man/man9/random_harvest.9 b/share/man/man9/random_harvest.9
index eba4245..200605d 100644
--- a/share/man/man9/random_harvest.9
+++ b/share/man/man9/random_harvest.9
@@ -27,76 +27,85 @@
.\"
.Dd February 6, 2002
.Dt RANDOM_HARVEST 9
-.Os FreeBSD
+.Os
.Sh NAME
.Nm random_harvest
.Nd gather entropy from the kernel for the entropy device
.Sh SYNOPSIS
-.Fd #include <sys/random.h>
+.In sys/random.h
.Ft void
-.Fn random_harvest "void *entropy" "u_int size" "u_int bits" "u_int frac" "enum esource source"
+.Fo random_harvest
+.Fa "void *entropy"
+.Fa "u_int size"
+.Fa "u_int bits"
+.Fa "u_int frac"
+.Fa "enum esource source"
+.Fc
.Sh DESCRIPTION
The
-.Nm
+.Fn random_harvest
function is used by device drivers
and other kernel processes to pass data
that is considered (at least partially) stochastic
to the entropy device.
.Pp
The caller should pass a pointer (to no more than 16 bytes) of
-the ``random'' data in
-.Ar entropy.
+the
+.Dq random
+data in
+.Fa entropy .
The argument
-.Ar size
+.Fa size
contains the number of bytes pointed to.
The caller should
-.Em very conservatively
+.Em "very conservatively"
estimate the number of random bits
in the sample,
and pass this in
-.Ar bits
+.Fa bits
or
-.Ar frac .
+.Fa frac .
If the estimated number of bits per sample is an integer, then
-.Ar bits
+.Fa bits
is used, and
-.Ar frac is 0.
+.Fa frac
+is 0.
Otherwise,
for low-entropy samples,
-``fractional'' entropy can be supplied in
-.Ar frac
+.Dq fractional
+entropy can be supplied in
+.Fa frac .
(This is considered to be
-.Ar frac /
-1024 bits of entropy).
+.Fa frac /
+1024 bits of entropy.)
The
-.Ar source
+.Fa source
is chosen from
-.Dv RANDOM_WRITE ,
-.Dv RANDOM_KEYBOARD ,
-.Dv RANDOM_MOUSE ,
-.Dv RANDOM_NET
+.Dv RANDOM_WRITE , RANDOM_KEYBOARD , RANDOM_MOUSE , RANDOM_NET
and
-.Dv RANDOM_INTERRUPT
+.Dv RANDOM_INTERRUPT ,
and is used to indicate the source of the entropy.
.Pp
Interrupt harvesting has been simplified
for the kernel programmer.
If a device driver registers an interrupt handler
with
-.Fn BUS_SETUP_INTR
+.Xr BUS_SETUP_INTR 9
or
-.Fn bus_setup_intr ,
+.Xr bus_setup_intr 9 ,
then it is only necessary to
-include the INTR_ENTROPY bit in the
-.Ar flags
+include the
+.Dv INTR_ENTROPY
+bit in the
+.Fa flags
argument to have that interrupt source
be used for entropy harvesting.
.Sh SEE ALSO
.Xr random 4 ,
.Xr BUS_SETUP_INTR 9
-.Sh AUTHOR
+.Sh AUTHORS
The
.Fx
-.Pa /dev/random
+.Xr random 4
entropy device and supporting documentation was written by
.An Mark R V Murray .
OpenPOWER on IntegriCloud