@@ -4,21 +4,21 @@ This is an application to test the functionality of the RDRAND instruction in x8
4
4
## Pre-built Binaries
5
5
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.
6
6
### Windows
7
- 1 . Obtain MinGW/GCC from winlibs.
8
- 2 . Prepare manifest for UAC by executing ` windres win_manifest/ resource.rc manifest.o ` .
9
- 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 ` .
7
+ 1 . Obtain MinGW/GCC from [ winlibs] ( https://github.com/brechtsanders/winlibs_mingw ) .
8
+ 2 . Prepare manifest for UAC by executing ` windres win_manifest\ resource.rc obj\ manifest.o ` .
9
+ 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 ` .
10
10
### Linux
11
11
1 . Install GCC.
12
- 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 ` .
12
+ 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 ` .
13
13
14
14
## Example Output
15
15
Below is an example of the output produced by this application on a CPU with a properly functioning RDRAND instruction.
16
16
```
17
17
================================================================================
18
18
RDRAND Tester v20210328 x86_64
19
19
--------------------------------------------------------------------------------
20
- Compiled on Mar 28 2021
21
- Compiled with GNU Compiler Collection (GCC) 10.2 .0
20
+ Compiled on Apr 16 2021
21
+ Compiled with GNU Compiler Collection (GCC) 10.3 .0
22
22
================================================================================
23
23
24
24
Running on Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
@@ -28,26 +28,26 @@ This CPU supports the following instructions:
28
28
29
29
Testing RDRAND...
30
30
31
- try: 1 success: 1 random number: 5927373127459600547 (0x52424274716cf8a3 )
32
- try: 2 success: 1 random number: 14017878035415681363 (0xc28981cda5b3c953 )
33
- try: 3 success: 1 random number: 11368319004864247053 (0x9dc461e72a41750d )
34
- try: 4 success: 1 random number: 18347068400624210050 (0xfe9de180e1001082 )
35
- try: 5 success: 1 random number: 14957356374446914942 (0xcf93346005d53d7e )
36
- try: 6 success: 1 random number: 6886028350544393428 (0x5f90164d1377b4d4 )
37
- try: 7 success: 1 random number: 5278664944371065288 (0x494195cca18b61c8 )
38
- try: 8 success: 1 random number: 4521303152649964506 (0x3ebee5432f8e0bda )
39
- try: 9 success: 1 random number: 15534923940847327720 (0xd797230442ea99e8 )
40
- try: 10 success: 1 random number: 3670930976467298914 (0x32f1c4460f4faa62 )
41
- try: 11 success: 1 random number: 11958149365487776571 (0xa5f3e17dacf6333b )
42
- try: 12 success: 1 random number: 5020999880033320980 (0x45ae2cc9daaa4014 )
43
- try: 13 success: 1 random number: 16330053013882295375 (0xe2a000b21fc0544f )
44
- try: 14 success: 1 random number: 1697571542229226260 (0x178efc52d3629314 )
45
- try: 15 success: 1 random number: 12609148070264663482 (0xaefcb15d206d6dba )
46
- try: 16 success: 1 random number: 11259769587200697446 (0x9c42bcc861d82466 )
47
- try: 17 success: 1 random number: 4671383702711260616 (0x40d416ba41a755c8 )
48
- try: 18 success: 1 random number: 2964570895778270359 (0x29244585d2534c97 )
49
- try: 19 success: 1 random number: 16437644231134559834 (0xe41e3e567d063e5a )
50
- try: 20 success: 1 random number: 12484713343223626958 (0xad429ca3896c7cce )
31
+ try: 1 success: 1 random number: 5012598193280705724 (0x4590537fb842e4bc )
32
+ try: 2 success: 1 random number: 13057969725578991747 (0xb5373a4804f0d883 )
33
+ try: 3 success: 1 random number: 15258542471905877516 (0xd3c13b88f4291e0c )
34
+ try: 4 success: 1 random number: 2878339394249548515 (0x27f1ea6dd141e2e3 )
35
+ try: 5 success: 1 random number: 5238856747007213768 (0x48b428746a8600c8 )
36
+ try: 6 success: 1 random number: 12836524077560437497 (0xb2247ea341bd1af9 )
37
+ try: 7 success: 1 random number: 15869268653934935726 (0xdc3af7c303087eae )
38
+ try: 8 success: 1 random number: 17374580931805302711 (0xf11ee94d9187cfb7 )
39
+ try: 9 success: 1 random number: 2260023498090627146 (0x1f5d3765bbba404a )
40
+ try: 10 success: 1 random number: 380621888462874021 (0x05483d97479165a5 )
41
+ try: 11 success: 1 random number: 17765201729153443702 (0xf68aacd93d58a776 )
42
+ try: 12 success: 1 random number: 17666429294697117999 (0xf52bc3d7bff9f92f )
43
+ try: 13 success: 1 random number: 10586101450554073644 (0x92e9632e8485e22c )
44
+ try: 14 success: 1 random number: 3888766898547441689 (0x35f7ace40237c019 )
45
+ try: 15 success: 1 random number: 5764275204437754665 (0x4ffed1c20c1ac329 )
46
+ try: 16 success: 1 random number: 8845614113758411495 (0x7ac1ef2b9ec07ae7 )
47
+ try: 17 success: 1 random number: 4829856922400078030 (0x43071947ff9e38ce )
48
+ try: 18 success: 1 random number: 6630984605313841605 (0x5c05fd5db6d0b9c5 )
49
+ try: 19 success: 1 random number: 6917881360425400011 (0x60014071de73b6cb )
50
+ try: 20 success: 1 random number: 18115961797194281831 (0xfb68d345a64ff367 )
51
51
52
52
The RDRAND instruction of this CPU appears to be working.
53
53
The numbers generated should be different and random.
0 commit comments