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

chore(crypto): hardening against potential side-channel leakage

Public commit record

What the developer wrote

Authored by M1nd3r

85/100 · Strong
chore(crypto): hardening against potential side-channel leakage

Two issues
- Using `volatile cond` twice in a single `assert`, i.e. `assert(cond == 0 | cond == 1)`
results in two conditional branches (potentially distinguishable).
- Memory access is (potentially) dependent on the secret exponent. This
is not an expoitable issue, as Trezor does not utilize a memory cache.

Solution
- Using `cond` only once in the `assert` (`assert(cond <= 1)`), which
is compiled into a single branch.
- Using `point_select` makes the memory access independent of the secret
exponent.

Note that all `assert`s in the C code are compiled into production core
firmware, so the first issue DOES affect the production code.

[no changelog]

Co-authored-by: Yudis-bit <85178972+Yudis-bit@users.noreply.github.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit hardens cryptographic code in Trezor firmware against two potential side-channel leaks. First, it simplifies how a secret condition value is checked inside an assert statement so the compiler produces only one branch instead of two, reducing the chance that timing or power analysis could reveal whether the value was 0 or 1. Second, it replaces direct table lookups that depended on a secret scalar with a constant-time selection helper that always reads every table entry. The commit message explicitly says the memory-access issue is not exploitable on Trezor because the device has no cache, but the assert issue does affect production firmware because asserts are compiled in.

Recommended action

Treat as a legitimate hardening patch with limited real-world exploitability on current Trezor hardware. Review whether similar assert patterns or secret-dependent table lookups exist elsewhere in the crypto codebase, especially in newer curves or third-party imported code. No urgent security release action is required solely on the basis of this diff, but the patch should be included in the next firmware build.

Security signals we found

01

Side-channel hardening in constant-time cryptographic primitives

02

Replacement of double-evaluation volatile assert with single-branch assert

03

Elimination of secret-dependent memory access in elliptic-curve scalar multiplication

04

Use of LOCAL_CONFIDENTIAL and memzero for sensitive intermediate point

05

Commit message states asserts are compiled into production core firmware

Risk score

Why this scored 47/100

Our methodology →
Potential impact 12/30
Exploitability 6/25
Stealth signal 10/15
Affected reach 8/15
Confidence 7/10
Evidence quality 4/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.