Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cjee21 authored Apr 16, 2021
1 parent 83f700e commit 4cd2970
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ This is an application to test the functionality of the RDRAND instruction in x8
## Pre-built Binaries
The pre-built binaries can be found in the [releases](https://github.com/cjee21/RDRAND-Tester/releases) section. The binaries were built as described below.
### Windows
1. Obtain MinGW/GCC from winlibs.
2. Prepare manifest for UAC by executing `windres win_manifest/resource.rc manifest.o`.
3. Build the binary by executing `gcc RDRAND_Tester.c manifest.o -o RDRAND_Tester.exe -Wall -Wconversion -Wformat-security -std=c17 -O3 -Wl,--nxcompat,--dynamicbase,--high-entropy-va -s`.
1. Obtain MinGW/GCC from [winlibs](https://github.com/brechtsanders/winlibs_mingw).
2. Prepare manifest for UAC by executing `windres win_manifest\resource.rc obj\manifest.o`.
3. Build the binary by executing `gcc RDRAND_Tester.c obj\manifest.o -o release\RDRAND_Tester_Windows.exe -Wall -Wconversion -Wformat-security -std=c17 -O3 -static -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -fstack-clash-protection -fcf-protection -Wl,-pie,--no-copy-dt-needed-entries,--as-needed,--nxcompat,--dynamicbase,--high-entropy-va -s`.
### Linux
1. Install GCC.
2. Build the binary by executing `gcc RDRAND_Tester.c -o RDRAND_Tester -Wall -Wconversion -Wformat-security -O3 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -fstack-clash-protection -fcf-protection -Wl,-z,relro,-z,now,-pie,--hash-style=gnu,--no-copy-dt-needed-entries,--as-needed -s`.
2. Build the binary by executing `gcc RDRAND_Tester.c -o release/RDRAND_Tester_Linux -Wall -Wconversion -Wformat-security -O3 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -fstack-clash-protection -fcf-protection -Wl,-z,relro,-z,now,-pie,--hash-style=gnu,--no-copy-dt-needed-entries,--as-needed -s`.

## Example Output
Below is an example of the output produced by this application on a CPU with a properly functioning RDRAND instruction.
```
================================================================================
RDRAND Tester v20210328 x86_64
--------------------------------------------------------------------------------
Compiled on Mar 28 2021
Compiled with GNU Compiler Collection (GCC) 10.2.0
Compiled on Apr 16 2021
Compiled with GNU Compiler Collection (GCC) 10.3.0
================================================================================
Running on Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Expand All @@ -28,26 +28,26 @@ This CPU supports the following instructions:
Testing RDRAND...
try: 1 success: 1 random number: 5927373127459600547 (0x52424274716cf8a3)
try: 2 success: 1 random number: 14017878035415681363 (0xc28981cda5b3c953)
try: 3 success: 1 random number: 11368319004864247053 (0x9dc461e72a41750d)
try: 4 success: 1 random number: 18347068400624210050 (0xfe9de180e1001082)
try: 5 success: 1 random number: 14957356374446914942 (0xcf93346005d53d7e)
try: 6 success: 1 random number: 6886028350544393428 (0x5f90164d1377b4d4)
try: 7 success: 1 random number: 5278664944371065288 (0x494195cca18b61c8)
try: 8 success: 1 random number: 4521303152649964506 (0x3ebee5432f8e0bda)
try: 9 success: 1 random number: 15534923940847327720 (0xd797230442ea99e8)
try: 10 success: 1 random number: 3670930976467298914 (0x32f1c4460f4faa62)
try: 11 success: 1 random number: 11958149365487776571 (0xa5f3e17dacf6333b)
try: 12 success: 1 random number: 5020999880033320980 (0x45ae2cc9daaa4014)
try: 13 success: 1 random number: 16330053013882295375 (0xe2a000b21fc0544f)
try: 14 success: 1 random number: 1697571542229226260 (0x178efc52d3629314)
try: 15 success: 1 random number: 12609148070264663482 (0xaefcb15d206d6dba)
try: 16 success: 1 random number: 11259769587200697446 (0x9c42bcc861d82466)
try: 17 success: 1 random number: 4671383702711260616 (0x40d416ba41a755c8)
try: 18 success: 1 random number: 2964570895778270359 (0x29244585d2534c97)
try: 19 success: 1 random number: 16437644231134559834 (0xe41e3e567d063e5a)
try: 20 success: 1 random number: 12484713343223626958 (0xad429ca3896c7cce)
try: 1 success: 1 random number: 5012598193280705724 (0x4590537fb842e4bc)
try: 2 success: 1 random number: 13057969725578991747 (0xb5373a4804f0d883)
try: 3 success: 1 random number: 15258542471905877516 (0xd3c13b88f4291e0c)
try: 4 success: 1 random number: 2878339394249548515 (0x27f1ea6dd141e2e3)
try: 5 success: 1 random number: 5238856747007213768 (0x48b428746a8600c8)
try: 6 success: 1 random number: 12836524077560437497 (0xb2247ea341bd1af9)
try: 7 success: 1 random number: 15869268653934935726 (0xdc3af7c303087eae)
try: 8 success: 1 random number: 17374580931805302711 (0xf11ee94d9187cfb7)
try: 9 success: 1 random number: 2260023498090627146 (0x1f5d3765bbba404a)
try: 10 success: 1 random number: 380621888462874021 (0x05483d97479165a5)
try: 11 success: 1 random number: 17765201729153443702 (0xf68aacd93d58a776)
try: 12 success: 1 random number: 17666429294697117999 (0xf52bc3d7bff9f92f)
try: 13 success: 1 random number: 10586101450554073644 (0x92e9632e8485e22c)
try: 14 success: 1 random number: 3888766898547441689 (0x35f7ace40237c019)
try: 15 success: 1 random number: 5764275204437754665 (0x4ffed1c20c1ac329)
try: 16 success: 1 random number: 8845614113758411495 (0x7ac1ef2b9ec07ae7)
try: 17 success: 1 random number: 4829856922400078030 (0x43071947ff9e38ce)
try: 18 success: 1 random number: 6630984605313841605 (0x5c05fd5db6d0b9c5)
try: 19 success: 1 random number: 6917881360425400011 (0x60014071de73b6cb)
try: 20 success: 1 random number: 18115961797194281831 (0xfb68d345a64ff367)
The RDRAND instruction of this CPU appears to be working.
The numbers generated should be different and random.
Expand Down

0 comments on commit 4cd2970

Please sign in to comment.