Questions tagged [rdrand]

RdRand (also RDRAND) is an instruction for returning random numbers from an on-chip random number generator.

RdRand (also RDRAND) is an instruction for returning random numbers from an on-chip random number generator. RdRand is available in Ivy Bridge processors and is part of the Intel 64 instruction set architecture. The random number generator is NIST SP800-90A, FIPS 140-2, and ANSI X9.82 compliant

From http://en.wikipedia.org/wiki/RdRand

39 questions
2
votes
2 answers

Valgrind Installation error in Oracle Linux

I am working on Oracle Linux Server release 6.5. GCC version 4.4.7 I am trying to install Valgrind valgrind-3.17.0 but ending up in error. Can you please suggest on the below issue? Thanks in advance. Below are the steps I followed: ./configure When…
2
votes
1 answer

How to use Intel's RDRAND using inline assembly with .Net

I'm using an Intel Ivy Bridge CPU and want to use the RDRAND opcode (https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide) in C#. How can I call this CPU instruction via C#? I've seen an…
Mike de Klerk
  • 11,906
  • 8
  • 54
  • 76
2
votes
2 answers

Availability of _rdrand_step intrinsics under Microsoft compilers?

According to Microsoft's x64 (amd64) Intrinsics List, Microsoft offers an intrinsic for RDRAND: _rdrand16_step _rdrand32_step _rdrand64_step However, the page does not discuss detecting the availability of the intrinsic. There is a footnote with…
jww
  • 97,681
  • 90
  • 411
  • 885
1
vote
2 answers

Intel RDSEED 64 only giving 5 bytes of data

I'm trying to generate 8 bytes of random data using RDSEED (to seed SecureRandom in Java), by getting the 8 bytes from the 64-bit unsigned integer it generates. The problem is, while testing my code, I noticed that there are always 3 bytes that are…
f478ccf2
  • 55
  • 2
1
vote
1 answer

Proper usage of RDRAND (on chip generator) as std::random_device with Visual C++'s random library

I would like to be able to use the hardware random number generator, when available and regardless of intel or amd running the code, with C++ random library: void randomDeviceBernouilli(double bernoulliParameter, uint64_t trialCount) { …
Vectorizer
  • 1,076
  • 9
  • 24
1
vote
1 answer

Generate a random 32-bit number to store in a 64-bit register

I want to generate a random 32-bit number. I am using rdrand for this. However, I am having some problems. Since the number can be no more than 32 bits large, I am doing rdrand eax. Here is where the problem arises: I need to be able to refer to…
Caspian Ahlberg
  • 934
  • 10
  • 19
1
vote
1 answer

Is the rdrand instruction available on AMD FX 8350?

I am evaluating the feasibility of moving a simulation to a FX 8350. Is there a document on the availability (if not, a workaround) of the rdrand instruction of Intel's BullMountain on AMD FX 8350? Thanks in advance
Vectorizer
  • 1,076
  • 9
  • 24
1
vote
1 answer

error: invalid 'asm': operand number missing after %-letter

I'm trying to write this inline assembly, which returns a random number using the rdrand instruction. The number is stored in the eax register, and then moved to the rng_num variable. But I get the error that is in the title. uint32_t rng_num; …
user10481362
1
vote
1 answer

Working example Intel RdRand in C language. How to generate a float type number in the range -100.001 through +100.001

There is an Intel DRNG Library that allows you to use a random number generator based on the processor's crystal entropy effect. The library itself and an instruction of its use:…
Dennis V
  • 574
  • 7
  • 19
1
vote
1 answer

The rdseed instruction with multiple threads

I would like to generate seeds for a custom PRNG using the rdseed instruction with multiple cores. Here is what I have so far using OpenMP. //gcc -Wall -O3 -fopenmp -mrdseed myrand.c #include #include int main(void) { …
Z boson
  • 32,619
  • 11
  • 123
  • 226
1
vote
3 answers

How to add RDRAND instruction into 64-bit code compiled with VS 2008?

I'm working on a C++ project in Visual Studio 2008 IDE, where I need to use Intel's new RDRAND instruction. I did a quick search, and MSDN recommends using _rdrand64_step intrinsic defined in immintrin.h, which I do not have in VS 2008. In a 32-bit…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
1
vote
1 answer

How to set REX prefix when using RDRAND under GCC?

I'm trying to use Intel's RDRAND instruction. According to the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 2 (page 4-298), RDRAND produces 32-bit random values by default, even on 64-bit machines: In 64-bit mode, the…
jww
  • 97,681
  • 90
  • 411
  • 885
1
vote
0 answers

How to access Intel Random Number generator RdRand in C++?

Normally, I use the following lines to generate pseudo-random numbers in C++ code: srand(time(0)); int x = rand() % 100; // 0 ~ 99 But since Intel has implemented random generator hardware in their new processors, I want to take advantage of the…
astr627
  • 13
  • 1
  • 4
1
vote
1 answer

Using Intel's RdRand opcode in Delphi 6/7

is there a way to use Intel's RdRand opcode in older Delphi versions like 6 or 7? Maybe using asm db $... end; or something? How do I store the number into a variable? Speed is very important. I can't use an external library for this.
blubb
  • 55
  • 1
  • 1
  • 10
0
votes
1 answer

Does CryptGenRandom use the RNG in my processor?

On Windows, CryptGenRandom is the standard random number generator to use. It is called by many packages like Python’s Random and Secrets modules, which both use os.urandom, which in turns calls CryptGenRandom. For the algorithm of CryptGenRandom, I…
Riemann
  • 158
  • 10