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
32
votes
4 answers

What is the latency and throughput of the RDRAND instruction on Ivy Bridge?

I cannot find any info on agner.org on the latency or throughput of the RDRAND instruction. However, this processor exists, so the information must be out there. Edit: Actually the newest optimization manual mentions this instruction. It is…
user239558
  • 6,964
  • 1
  • 28
  • 35
18
votes
5 answers

True random numbers with C++11 and RDRAND

I have seen that Intel seems to have included a new assembly function to get real random numbers obtained from hardware. The name of the instruction is RdRand, but only a small amount of details seem accessible on it on Internet:…
Vincent
  • 57,703
  • 61
  • 205
  • 388
16
votes
6 answers

Is there any legitimate use for Intel's RDRAND?

Today I thought: well, even if there is great suspicion on RDRAND implementation of NIST SP 800-90A, it is still a hardware implementation of pseudo-random number generator (PRNG) that must be good enough for non-sensitive applications. So I thought…
lvella
  • 12,754
  • 11
  • 54
  • 106
12
votes
3 answers

What are the exhaustion characteristics of RDRAND on Ivy Bridge?

After reviewing the Intel Digital Random Number Generator (DRNG) Software Implementation Guide, I have a few questions about what happens to the internal state of the generator when RDRAND is invoked. Unfortunately the answers don't seem to be in…
cambecc
  • 4,083
  • 1
  • 23
  • 24
8
votes
2 answers

How I can get the random number from Intel's processor with assembler?

I need to get random number from Intel's random generator in processor (Intel Core i3). I don't want to use any library. I want use assembler paste in C++, but I don't khow which registers and instructions should use.
6
votes
1 answer

How to use RDRAND intrinsics?

I was looking at H.J. Lu's PATCH: Update x86 rdrand intrinsics. I can't tell if I should be using _rdrand_u64, _rdrand64_step, or if there are other function(s). There does not appear to be test cases written for them. There also seems to be a lack…
jww
  • 97,681
  • 90
  • 411
  • 885
6
votes
3 answers

using the hardware rng from python

Are there any ready made libraries so that the intel hardware prng (rdrand) can be used by numpy programs to fill buffers of random numbers? Failing this can someone point me in the right direction for some C code that I could adapt or use (I use…
staticd
  • 1,194
  • 9
  • 13
6
votes
1 answer

Way to interface with Intel's new DRNG (RDRAND instruction) from C#?

I'm looking to consume Intel's Digital Random Number Generator (the RDRAND instruction in Ivy Bridge) from a C# assembly. I've looked at cpp libs but I was hoping there was a more "managed" solution. Any ideas?
Jeff
  • 2,701
  • 2
  • 22
  • 35
5
votes
3 answers

RDRAND and RDSEED intrinsics on various compilers?

Does Intel C++ compiler and/or GCC support the following Intel intrinsics, like MSVC does since 2012 / 2013? #include // for the following intrinsics int _rdrand16_step(uint16_t*); int _rdrand32_step(uint32_t*); int…
SEJPM
  • 262
  • 4
  • 12
5
votes
1 answer

Read Intel DRBG parameters

Newer Intel processors include a DRBG, which generates random numbers which you can read with the RDRAND instruction. It involves a 256-bit seed S generated from a hardware entropy source dependant on noise in a metastable oscillator. The…
Falcon Momot
  • 1,065
  • 8
  • 20
4
votes
1 answer

Is FLAGS/EFLAGS part of "CC" (condition control) for clobber list?

This is a follow up to What is "=qm" in extended assembler. When using RDRAND, it sets (or unsets) the Carry Flag (CF): char rc; unsigned int val; __asm__ volatile( "rdrand %0 ; setc %1" : "=r" (val), "=qm" (rc) ); // 1 = success, 0 =…
jww
  • 97,681
  • 90
  • 411
  • 885
3
votes
0 answers

Why isn't the speed of AMD 5600 hardware random number generator steady in my C++ code?

I was testing the speed of AMD 5600 h/w random number generator (rdrand) in C++ and found the speed isn't steady. Is this normal or am I doing something wrong ? Here is the used code: #include #include #include int…
mlauronen
  • 31
  • 3
3
votes
0 answers

Why does RDRAND lead to data cache accesses and misaligned loads on Zen 3?

I am currently benchmarking and optimizing a program that makes heavy use of rdrand instructions. When looking for suspected performance penalties from misaligned loads/stores, I noticed an excessively high value of the ls_misal_loads.ma64 (64-byte…
janw
  • 8,758
  • 11
  • 40
  • 62
3
votes
1 answer

converting ASM instruction RDRand to Win64

I have this function (RDRand - written by David Heffernan) that seam to work ok in 32 bit, but failed in 64 bit : function TryRdRand(out Value: Cardinal): Boolean; {$IF defined(CPU64BITS)} asm .noframe {$else} asm {$ifend} db $0f db $c7 db…
zeus
  • 12,173
  • 9
  • 63
  • 184
3
votes
3 answers

Is intel's RdRand TRNG or PRNG?

I've searched the net for quite a while and couldn't find a definitive answer. I want to know the quality of random numbers generated by intel's rdrand instructions. How does it compare to IDQ's cards for example? Is it truly random or pseudo…
Davita
  • 8,928
  • 14
  • 67
  • 119
1
2 3