User Manual for the Rdrand Library (Linux* Version)

Download Source

About

This is the Rdrand Library, a project designed to bring the rdrand instruction to customers who would traditionally not have access to it.

The new "rdrand" instruction is available at all privilege levels to any programmer. Unfortunately, however, since this technology is so new, toolchain support is limited. The goal of this library is to provide easy-to-use access to this feature through a pre-compiled static library. A second level goal is to provide a consistent, small, and very easy-to-use API to access the "rdrand" instruction for various sizes of random data. Finally, the source code and build system are provided for the entire library allowing any needed changes.

One limitation of the new rdrand instruction is that it does not guarantee to return a result to the caller--instead it may return that the hardware is not ready. As part of API simplification, this can be handled transparently by requesting a loop (default of 10 iterations, not user-configurable, but changeable in the source) to wait for the hardware to become ready, or fail.