I was wondering if there is a way to make use of the new hardware based true number generator found in intel\'s sandy bridge CPU? I read that intel\'s MKL (Math Kernel Libra
Here is the example code:
#include
#include
...
uint64_t val;
if(!_rdseed64_step(&val)) {
printf("Error generating hardware random value\n");
}
// Now val contains 64-bit pseudo-random number
uint64_t val;
if(!_rdrand64_step(&val)) {
printf("Error generating hardware random value\n");
}
// Now val contains 64-bit true random number
Reference: Intel Intrinsics Guide