0001 ==========================================================
0002 Linux support for random number generator in i8xx chipsets
0003 ==========================================================
0004
0005 Introduction
0006 ============
0007
0008 The hw_random framework is software that makes use of a
0009 special hardware feature on your CPU or motherboard,
0010 a Random Number Generator (RNG). The software has two parts:
0011 a core providing the /dev/hwrng character device and its
0012 sysfs support, plus a hardware-specific driver that plugs
0013 into that core.
0014
0015 To make the most effective use of these mechanisms, you
0016 should download the support software as well. Download the
0017 latest version of the "rng-tools" package from the
0018 hw_random driver's official Web site:
0019
0020 http://sourceforge.net/projects/gkernel/
0021
0022 Those tools use /dev/hwrng to fill the kernel entropy pool,
0023 which is used internally and exported by the /dev/urandom and
0024 /dev/random special files.
0025
0026 Theory of operation
0027 ===================
0028
0029 CHARACTER DEVICE. Using the standard open()
0030 and read() system calls, you can read random data from
0031 the hardware RNG device. This data is NOT CHECKED by any
0032 fitness tests, and could potentially be bogus (if the
0033 hardware is faulty or has been tampered with). Data is only
0034 output if the hardware "has-data" flag is set, but nevertheless
0035 a security-conscious person would run fitness tests on the
0036 data before assuming it is truly random.
0037
0038 The rng-tools package uses such tests in "rngd", and lets you
0039 run them by hand with a "rngtest" utility.
0040
0041 /dev/hwrng is char device major 10, minor 183.
0042
0043 CLASS DEVICE. There is a /sys/class/misc/hw_random node with
0044 two unique attributes, "rng_available" and "rng_current". The
0045 "rng_available" attribute lists the hardware-specific drivers
0046 available, while "rng_current" lists the one which is currently
0047 connected to /dev/hwrng. If your system has more than one
0048 RNG available, you may change the one used by writing a name from
0049 the list in "rng_available" into "rng_current".
0050
0051 ==========================================================================
0052
0053
0054 Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
0055 - Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
0056 - Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
0057
0058
0059 About the Intel RNG hardware, from the firmware hub datasheet
0060 =============================================================
0061
0062 The Firmware Hub integrates a Random Number Generator (RNG)
0063 using thermal noise generated from inherently random quantum
0064 mechanical properties of silicon. When not generating new random
0065 bits the RNG circuitry will enter a low power state. Intel will
0066 provide a binary software driver to give third party software
0067 access to our RNG for use as a security feature. At this time,
0068 the RNG is only to be used with a system in an OS-present state.
0069
0070 Intel RNG Driver notes
0071 ======================
0072
0073 FIXME: support poll(2)
0074
0075 .. note::
0076
0077 request_mem_region was removed, for three reasons:
0078
0079 1) Only one RNG is supported by this driver;
0080 2) The location used by the RNG is a fixed location in
0081 MMIO-addressable memory;
0082 3) users with properly working BIOS e820 handling will always
0083 have the region in which the RNG is located reserved, so
0084 request_mem_region calls always fail for proper setups.
0085 However, for people who use mem=XX, BIOS e820 information is
0086 **not** in /proc/iomem, and request_mem_region(RNG_ADDR) can
0087 succeed.
0088
0089 Driver details
0090 ==============
0091
0092 Based on:
0093 Intel 82802AB/82802AC Firmware Hub (FWH) Datasheet
0094 May 1999 Order Number: 290658-002 R
0095
0096 Intel 82802 Firmware Hub:
0097 Random Number Generator
0098 Programmer's Reference Manual
0099 December 1999 Order Number: 298029-001 R
0100
0101 Intel 82802 Firmware HUB Random Number Generator Driver
0102 Copyright (c) 2000 Matt Sottek <msottek@quiknet.com>
0103
0104 Special thanks to Matt Sottek. I did the "guts", he
0105 did the "brains" and all the testing.