Add support for using DRNG random number generator
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>
Tue, 18 Dec 2012 12:56:48 +0000 (14:56 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 18 Dec 2012 18:33:04 +0000 (19:33 +0100)
commitefd7002188e6d50013e4d9a920a8b9afa9d210e5
tree09adb14c6f19c50a45ae5c2fb3067c08435506d5
parentbfe4dc11bb822cbc5bf2b425e5a5a2867a904518
Add support for using DRNG random number generator

* configure.ac: Add option --disable-drng-support.
(ENABLE_DRNG_SUPPORT): New.
* random/rndhw.c (USE_DRNG): New.
(rdrand_long, rdrand_nlong, poll_drng): New.
(_gcry_rndhw_poll_fast, _gcry_rndhw_poll_slow): Call poll function.
* src/g10lib.h (HWF_INTEL_RDRAND): New.
* src/global.c (hwflist): Add "intel-rdrand".
* src/hwfeatures.c (detect_x86_64_gnuc) [ENABLE_DRNG_SUPPORT]: Detect
RDRAND.
(detect_ia32_gnuc) [ENABLE_DRNG_SUPPORT]: Detect RDRAND.
--

This patch provides support for using Digital Random Number Generator (DRNG)
engine, which is available on the latest Intel's CPUs. DRNG engine is
accesible via new the RDRAND instruction.

This patch adds the following:
- support for disabling using of rdrand instruction
- checking for RDRAND instruction support using cpuid
- RDRAND usage implementation

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
ChangeLog and editorial changes by wk.
configure.ac
random/rndhw.c
src/g10lib.h
src/global.c
src/hwfeatures.c