Author Topic: Quick and dirty RDRAND test  (Read 13214 times)

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Quick and dirty RDRAND test
« on: September 30, 2013, 08:41:42 AM »
Attached is the archive RAND1.ZIP; it contains the sources and the running EXE for a first RDRAND test application. It generates 1 billion random numbers and checks for generating errors. Here is the output of the program:
Code: [Select]
Generating 1 billion  random numbers with RDRAND
That'll take a little while ...

Number of generated random numbers = 1000000000
Generating errors                  = 0

Gunther
You have to know the facts before you can distort them.

KeepingRealBusy

  • Member
  • ***
  • Posts: 426
Re: Quick and dirty RDRAND test
« Reply #1 on: September 30, 2013, 09:09:06 AM »
Gunther,

I have read the links to the various discussions about rdrand, and checked my PDF's for my AMD laptop. I see no reference to RDRAND in any of the PDF's. Is this not supported except for INTEL chips?

Or is it just not mentioned for security reasons?

Dave.

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: Quick and dirty RDRAND test
« Reply #2 on: September 30, 2013, 09:40:21 AM »
It would be great to include a speed testing  ;)
Cod-Father

Paulo

  • Guest
Re: Quick and dirty RDRAND test
« Reply #3 on: September 30, 2013, 06:16:15 PM »
@KeepingRealBusy

As far as I know, AMD does not support RdRAND.
You can check this by first using CPUID then checking to see if bit 30 of ecx is set.
(as Gunther does in his code).
If not set means your cpu does not support RdRAND.

Another related instruction is RdSEED which can be used to seed a PRNG of arbitary width.

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Quick and dirty RDRAND test
« Reply #4 on: September 30, 2013, 07:54:39 PM »
RdRand is only available on intel ivy bridge processors, so far

from the wiki page...
Quote
A new random number generator and the RdRand instruction, codenamed Bull Mountain.

it's as though it was named so you could make your own punchline   :lol:

Paulo

  • Guest
Re: Quick and dirty RDRAND test
« Reply #5 on: September 30, 2013, 08:26:03 PM »
Quote from: dedndave

it's as though it was named so you could make your own punchline   :lol:

A few come to mind.   :biggrin:

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Quick and dirty RDRAND test
« Reply #6 on: September 30, 2013, 08:49:31 PM »
an interesting article...

http://spectrum.ieee.org/computing/hardware/behind-intels-new-randomnumber-generator

it's a shame the cloud of conspiracy might impair the future of technology

Paulo

  • Guest
Re: Quick and dirty RDRAND test
« Reply #7 on: September 30, 2013, 09:05:50 PM »
Very nice article dedndave.
Now if I can only find a lava lamp with USB interface. :biggrin:

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Re: Quick and dirty RDRAND test
« Reply #8 on: September 30, 2013, 09:12:25 PM »
Dave,

I have read the links to the various discussions about rdrand, and checked my PDF's for my AMD laptop. I see no reference to RDRAND in any of the PDF's. Is this not supported except for INTEL chips?

Up to now only for Intel Ivy Bridge processors.

Habran,

It would be great to include a speed testing  ;)

it's only quick and dirty. At the moment I'm writing a Monte Carlo simulation. Please have patience.

Gunther
You have to know the facts before you can distort them.

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: Quick and dirty RDRAND test
« Reply #9 on: September 30, 2013, 10:53:23 PM »
Quote
At the moment I'm writing a Monte Carlo simulation :icon_eek:

Please explain???
Cod-Father

Gunther

  • Member
  • *****
  • Posts: 4198
  • Forgive your enemies, but never forget their names
Re: Quick and dirty RDRAND test
« Reply #10 on: September 30, 2013, 11:07:05 PM »
Habran,

Quote
At the moment I'm writing a Monte Carlo simulation :icon_eek:

Please explain???

you're impatient. I'll provide not only the source (C + Assembly Language), but also the necessary mathematical background information.

Gunther
You have to know the facts before you can distort them.

habran

  • Member
  • *****
  • Posts: 1228
    • uasm
Re: Quick and dirty RDRAND test
« Reply #11 on: October 01, 2013, 05:49:00 AM »
Sagenhaft  8)
Cod-Father