From Flatassembler · Jessé · · 3m
AMD RNG Cannot Generate Zero
AMD processors fail to generate true zero with random number generators.
In brief
AMD processors fail to generate true zero with random number generators. AMD's random number generators cannot produce a true zero value at requested bit sizes, unlike Intel processors. Originally reported by Flatassembler.
AMD RNG Zero Problem
Jessé discovered AMD processors cannot generate a true zero value at requested bit sizes during assembly code testing for data visualization charts.
“Recently, while doing some assembly code to render data intro charts, and using 'rdrand' and 'rdseed' to provide that data to the displayed, I've figured out by accident what appears to be a bug (problem) only with AMD processors (maybe Zen2 only problem): they can't generate a number 0 at a given size!”
AMD vs Intel RNG Behavior
AMD processors show no zeros in 16-bit random number outputs while Intel processors generate zeros normally, causing chart rendering issues on AMD systems.
“Running the same programs on an Intel processor, and the 0's are there with no problem.”
Chart Application Test
Jessé created a chart application that visualizes random number generation from rdrand (red), rdseed (blue), and TSC-custom techniques (green) to identify zero generation problems.
“The first bar renders how many zeroes are being generated by rdrand (red), rdseed (blue) and TSC-custom technique (green), as well as other bars render the other 65535 numbers from the 16-bit space.”
AMD Zero Generation Issue
AMD processors never generate a true zero value at the requested bit size, while the lowest 16-bits can output zero when using 32-bit or 64-bit numbers.
“Yes, when using either 32-bit or 64-bit number, the lowest portion can output a zero, as I suggested on the attached example file as a modification to fix the problem. But a true zero (fitting the requested size), on AMD, never happens.”
AMD Response
AMD replied to Jessé's report but misinterpreted the results, possibly using AI to formulate their response, which was similar to ChatGPT's answer about the issue.
“Just to update you about this situation, AMD has replied me, but it seems that the guy from their team misread my results entirely, or used AI to formulate that reply (because his answer seems too similar to the one I got from ChatGPT when I checked if someone had previously figured this out before me).”
Hardware RNG Limitations
Security experts warn that hardware random number generators may have entropy flaws that could reduce cryptographic breaking times for attackers.
“At the time I was wandering in information system security, there was that rule of thumb: never ever use hardware accelerated crypto...”
RNG Performance Variations
Different processors show significant differences in random number generation speed: Core i5 (2012) generates 12.6 M numbers per second while AMD Ryzen 7 generates 2.6 M numbers per second.
“a Core i5 from 2012 generates 12.6 M numbers per second, while a Core i7 7700 from 2017 generates "only" 750 k numbers per second, and my AMD Ryzen 7 around 2.6 M numbers per second”
RNG Implementation Details
Intel's RDRAND uses an astable noise generator feeding into a clocked sampler with a de-bias circuit and serial shifter to create a 128-bit seed for cryptographic operations.
“It had an astable noise generator (a single bit), feeding into a clocked sampler, then a de-bias circuit, into a serial shifter. That created an internal 128-bit seed.”
AMD RNG Behavior
AMD's RNG circuit appears to have different versions or revisions even for models from the same manufacturer, causing inconsistent zero generation behavior.
“the random number generator circuit must have large differences, and probably completely different versions/revisions, even for models from the same manufacturer”
RNG Usage Context
For cryptographic purposes, OS-level RNGs are recommended over hardware RNGs due to potential backdoors in hardware random number generators.
“If you need it for cryptographic purposes, the OS's cryptographic RNG might be more coherent.”
Zero Generation Impact
The absence of zero values in AMD's random number generation affects chart rendering and data visualization applications that require zero as a baseline.
“On AMD host, never see the first bar change colors from green (which uses a TSC method I've created to generate random numbers), and also never see the base chart scale up from 0”
AMD Processor Test Results
Over 9 days, Jessé observed no zero values generated from two AMD processors, confirming the zero generation issue persists.
“Since 9 days before posting here, until the present moment, not a single 0 came out of the 2 AMDs that I had access to!”
RNG Testing Methodology
Jessé's application benchmarks RNG performance by counting how many numbers are generated per second across different processor models.
“it is now also possible to benchmark the random number generator, and it is also now possible to run the test on processors that do not have the 'rdseed' instruction”
AMD Hardware Limitations
AMD's random number generator circuit has limitations that affect zero generation but may not impact non-cryptographic applications.
“the AMD generator being completely inert to clock variation, and the Core i5 from 2: 100% dependent on the clock”
RNG Security Concerns
Hardware random number generators may have backdoors that could be exploited by attackers to reduce cryptographic breaking times.
“There are lots of places to hide a backdoor in there, and it would be extremely hard to detect without reverse engineering the silicon”
RNG Future Implications
AMD's RNG behavior may affect data visualization applications that require zero as a baseline for accurate chart rendering.
“On AMD host, never see the first bar change colors from green (which uses a TSC method I've created to generate random numbers), and also never see the base chart scale up from 0”
Here's the gist
AMD's random number generators cannot produce a true zero value at requested bit sizes, unlike Intel processors.

