mdoc(7) police: tidy up.

This commit is contained in:
Ruslan Ermilov 2002-03-18 16:52:32 +00:00
parent 21bb400da0
commit a689555c72
2 changed files with 53 additions and 45 deletions

View File

@ -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 .

View File

@ -36,9 +36,9 @@
.Nm rijndael_padEncrypt ,
.Nm rijndael_blockDecrypt ,
.Nm rijndael_padDecrypt
.Nd AES encryption.
.Nd AES encryption
.Sh SYNOPSIS
.Fd #include <crypto/rijndael/rijndael.h>
.In crypto/rijndael/rijndael.h
.Ft int
.Fo rijndael_makeKey
.Fa "keyInstance *key"
@ -86,40 +86,40 @@
.Fc
.Sh DESCRIPTION
The
.Nm rijndael_makeKey
.Fn rijndael_makeKey
function is used to set up the key schedule in
.Ar key .
.Fa key .
The
.Ar direction
.Fa direction
(which may be
.Dv DIR_ENCRYPT
or
.Dv DIR_DECRYPT )
specifies the intended use of the key.
The length of the key (in bits) is given in
.Ar keyLen ,
.Fa keyLen ,
and must be 128, 192 or 256.
The actual key is supplied in the buffer pointed to by
.Ar keyMaterial .
.Fa keyMaterial .
This material may be raw binary data,
or an ascii string containing a hexadecimal rendition
or an ASCII string containing a hexadecimal rendition
of the raw binary data,
dependent on a compile-time option in the
.Nm
sources -
sources,
.Dv BINARY_KEY_MATERIAL .
.Pp
.Sh RETURN VALUES
The
.Nm rijndael_makeKey
.Fn rijndael_makeKey
function will return
.Dv BAD_KEY_INSTANCE
if a null
.Ar key
if a
.Dv NULL
.Fa key
is passed,
.Dv BAD_KEY_DIR
if
.Ar direction
.Fa direction
is not
.Dv DIR_ENCRYPT
or
@ -130,6 +130,5 @@ if the key materials are not a hexadecimal string
and
.Dv TRUE
otherwise.
.Pp
.Sh AUTHOR
.An Mark R V Murray .
.Sh AUTHORS
.An Mark R V Murray