AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 30 Bitcoin

refactor(core): originate random number always from sec/rng

Public commit record

What the developer wrote

Authored by cepetr

67/100 · Adequate
refactor(core): originate random number always from sec/rng

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Names security-relevant behavior explicitly! No meaningful explanatory body
The short version

What changed, and why it matters

This commit is a code cleanup that makes all random-number generation in the Trezor firmware core go through one dedicated secure path (sec/rng). It also moves the old insecure test-only random generator into a separate file so it is only used in emulators and tests, not in real hardware. The change reduces the risk that a real device accidentally uses a weak random source, but the commit itself does not claim to fix a specific active vulnerability.

Recommended action

Treat as a hardening/refactoring change rather than an urgent security patch. Review that USE_INSECURE_PRNG is never defined in production firmware builds and that all new call sites correctly include sec/rng.h. Continue normal QA and consider whether this refactor addresses any previously identified weak-randomness concerns.

Security signals we found

01

Centralizes randomness source to a single hardware-backed RNG path

02

Isolates insecure LCG PRNG under USE_INSECURE_PRNG for tests/emulators only

03

Removes weak random_buffer fallback from production RNG code paths

04

Adds FIPS-style continuous RNG checks (previous/current comparison) in STM32 driver

05

Updates many cryptographic secret-generation call sites to use sec/rng

Risk score

Why this scored 30/100

Our methodology →
Potential impact 8/30
Exploitability 4/25
Stealth signal 3/15
Affected reach 6/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.