Software Archive
Read-only legacy content
17061 Discussions

rdrand failing on i7-4960x

ed_e_
Beginner
720 Views

I verified that it is supported on this chip by issuing CPUID, EAX=1, and find bit 30 set in ECX. However, when trying the loop below, RAX and CF are zeroed on first call and stay zero forever. I tried same code on an I7-4770K and it works fine, native and in a Hyper-V VM running on that system.

Does anyone know why this wouldn't work on the 4960x? Is something needed to kickstart the hardware rand generator?

thanks,

top: rdrand

       jnc top

       ret

 

 

0 Kudos
5 Replies
Bernard
Valued Contributor I
720 Views
0 Kudos
ed_e_
Beginner
720 Views

Thanks, I have already seen that doc and there is not anything in it other than use CPUID to verify support(I already did that) and issue the command, checking CF afterwards.

It is a one-instruction process, not much to it, and I am sure my code is OK because it works on other processors.

 I am looking for someone that has experience with rdrand and access to, or experience with, i7-4960x.

thanks,

 

0 Kudos
Bernard
Valued Contributor I
720 Views

Maybe you should post your question on ISA forum.

0 Kudos
zalia64
New Contributor I
720 Views

Ed: When / if you find the answer, please post it. I, too, wish to use that command - it solves a pressing need.

There are many projects in Physics and Applied Mathematics where a good random generator is useful. However, I would hesitate using it for high security cryptographic jobs: Are the numbers really random?   Recall the time when code of PGP encryption was 'munitions' and 'not allowed for export', long before September 11th. How come NSA allowed the rdrand mnemonic?  When the System offers a good cryptographic solution to anyone (including every terrorist) for free, be wary.

0 Kudos
Bernard
Valued Contributor I
720 Views

@zalia64

You raised an interesting question.

0 Kudos
Reply