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

hashes: interleave two independent hashes for 2-way SHA256d

Public commit record

What the developer wrote

Authored by jrakibi

81/100 · Strong
hashes: interleave two independent hashes for 2-way SHA256d

ARM SHA256H/H2 instructions take 4 cycles to produce a
result. the next `SHA256H` needs the result of the current
one as input, so the CPU has to wait until it is ready.
(in Transform 2 for eg, 3 out of every 4 cycles are wasted
doing nothing)

we fill those wasted cycles by computing a second independent
hash alongside the first.

See https://developer.arm.com/documentation/PJDOC-466751330-7215/r4p1/
(Section 3.20) for Cortex-A76 instruction timings. The exact
latency may differ on other ARM chips but the concept is the
same
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit is a performance optimization for SHA256 double hashing on 64-bit ARM processors. It rewrites a single-hash ARM hardware-accelerated routine to compute two independent hashes at the same time, filling otherwise wasted CPU cycles. There is no security bug being fixed and no new attack surface introduced; it is purely a speed improvement.

Recommended action

No security action required. Treat as a normal performance optimization. Reviewers may optionally verify that the two hash lanes do not share mutable state and that the output indexing is correct, but the diff shows clear variable separation and independent updates.

Security signals we found

01

No memory-safety changes: input/output lengths are fixed arrays and remain statically known

02

No new unsafe blocks or new target_feature flags introduced

03

No changes to public API or trait contracts visible in the diff

04

No constant tables or initial values modified

05

No branching, parsing, or user-controlled data handling added

Risk score

Why this scored 18/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 5/15
Confidence 9/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.