GitHunt
SI

SilverCard/RdRand

Windows .NET Framework Library to use Intel RdRand CPU instruction.

RdRand

Windows .NET Framework Library to use Intel RdRand CPU instruction.

RDRAND instruction is available in Ivy Bridge processors.

It includes a sample implementation.

NOTE: You will need the Visual C++ Redistributable installed.

Example

using SilverCard;

try
{
    var us = RdRand.Rand16(); // Random ushort
    var ui = RdRand.Rand32(); // Random uint
    var ul = RdRand.Rand64(); // Random ulong, only available when DLL is compiled for x64
}
catch (RandomGeneratorException ex)
{
    // If RDRAND instructions return false for 10 times, this exception will be throw.
}

Languages

C++63.1%C#30.7%C6.3%

Contributors

MIT License
Created July 25, 2018
Updated March 19, 2024