Skip to content

Commit 537878d

Browse files
David Brownelltorvalds
David Brownell
authored andcommitted
hw_random doc updates
Update documentation for the hw_random support to be current: - Documentation/hw_random.txt has been updated to reflect the current code: it's a framework now, a "core" with a small sysfs interface, that hardware-specific drivers plug in to. Text specific to Intel hardware is now at the end. - Kconfig now references the Documentation/hw_random.txt file and better explains what this really does. Both chunks of documentation now higlight the fact that the kernel entropy pool is maintained by "rngd", and this driver has nothing directly to do with that important task. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent cb622bb commit 537878d

File tree

2 files changed

+48
-20
lines changed

2 files changed

+48
-20
lines changed

Documentation/hw_random.txt

+40-19
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
2-
Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
3-
Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
4-
51
Introduction:
62

7-
The hw_random device driver is software that makes use of a
3+
The hw_random framework is software that makes use of a
84
special hardware feature on your CPU or motherboard,
9-
a Random Number Generator (RNG).
5+
a Random Number Generator (RNG). The software has two parts:
6+
a core providing the /dev/hw_random character device and its
7+
sysfs support, plus a hardware-specific driver that plugs
8+
into that core.
109

11-
In order to make effective use of this device driver, you
10+
To make the most effective use of these mechanisms, you
1211
should download the support software as well. Download the
1312
latest version of the "rng-tools" package from the
1413
hw_random driver's official Web site:
1514

1615
http://sourceforge.net/projects/gkernel/
1716

18-
About the Intel RNG hardware, from the firmware hub datasheet:
19-
20-
The Firmware Hub integrates a Random Number Generator (RNG)
21-
using thermal noise generated from inherently random quantum
22-
mechanical properties of silicon. When not generating new random
23-
bits the RNG circuitry will enter a low power state. Intel will
24-
provide a binary software driver to give third party software
25-
access to our RNG for use as a security feature. At this time,
26-
the RNG is only to be used with a system in an OS-present state.
17+
Those tools use /dev/hw_random to fill the kernel entropy pool,
18+
which is used internally and exported by the /dev/urandom and
19+
/dev/random special files.
2720

2821
Theory of operation:
2922

30-
Character driver. Using the standard open()
23+
CHARACTER DEVICE. Using the standard open()
3124
and read() system calls, you can read random data from
3225
the hardware RNG device. This data is NOT CHECKED by any
3326
fitness tests, and could potentially be bogus (if the
@@ -36,9 +29,37 @@ Theory of operation:
3629
a security-conscious person would run fitness tests on the
3730
data before assuming it is truly random.
3831

39-
/dev/hwrandom is char device major 10, minor 183.
32+
The rng-tools package uses such tests in "rngd", and lets you
33+
run them by hand with a "rngtest" utility.
34+
35+
/dev/hw_random is char device major 10, minor 183.
36+
37+
CLASS DEVICE. There is a /sys/class/misc/hw_random node with
38+
two unique attributes, "rng_available" and "rng_current". The
39+
"rng_available" attribute lists the hardware-specific drivers
40+
available, while "rng_current" lists the one which is currently
41+
connected to /dev/hw_random. If your system has more than one
42+
RNG available, you may change the one used by writing a name from
43+
the list in "rng_available" into "rng_current".
44+
45+
==========================================================================
46+
47+
Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
48+
Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
49+
Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
50+
51+
52+
About the Intel RNG hardware, from the firmware hub datasheet:
53+
54+
The Firmware Hub integrates a Random Number Generator (RNG)
55+
using thermal noise generated from inherently random quantum
56+
mechanical properties of silicon. When not generating new random
57+
bits the RNG circuitry will enter a low power state. Intel will
58+
provide a binary software driver to give third party software
59+
access to our RNG for use as a security feature. At this time,
60+
the RNG is only to be used with a system in an OS-present state.
4061

41-
Driver notes:
62+
Intel RNG Driver notes:
4263

4364
* FIXME: support poll(2)
4465

drivers/char/hw_random/Kconfig

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ config HW_RANDOM
99
Hardware Random Number Generator Core infrastructure.
1010

1111
To compile this driver as a module, choose M here: the
12-
module will be called rng-core.
12+
module will be called rng-core. This provides a device
13+
that's usually called /dev/hw_random, and which exposes one
14+
of possibly several hardware random number generators.
15+
16+
These hardware random number generators do not feed directly
17+
into the kernel's random number generator. That is usually
18+
handled by the "rngd" daemon. Documentation/hw_random.txt
19+
has more information.
1320

1421
If unsure, say Y.
1522

0 commit comments

Comments
 (0)