AMD's random number generator can't generate a 0?
Points and comments are a snapshot, not live.
A developer discovers AMD's RDRAND16 instruction can't generate a zero on Zen 2 CPUs.
A developer testing 'rdrand' and 'rdseed' for a data visualization project found that AMD processors (likely Zen 2) never generate a 16-bit zero with these instructions, while Intel CPUs do. The bug appears limited to the 16-bit form; using 32- or 64-bit outputs and then extracting the lower 16 bits yields zeros normally. The developer provides a test application to reproduce the issue and has contacted AMD for comment. Speculation in the thread suggests the bug may be a microcode fix that overcorrected an earlier 'always generate all 1s' flaw.
What commenters are saying
Top commenters note the bug has little practical impact since RDRAND is usually used to seed a CSPRNG, not directly for crypto keys. Some cite historical distrust of hardware RNGs, including pressure from Intel engineers to rely solely on RDRAND for /dev/random. Multiple users confirm the issue on Zen 2 but not Zen 3 or Zen 4. A key technical detail emerges: the instruction may actually produce zeros but erroneously set CF=0 (retry flag), causing software to discard them. Another commenter recalls a previous Zen 2 bug where RDRAND always returned -1, fixed via microcode.