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

hashes: Add optimized ARM SHA256d for 64-byte input

Public commit record

What the developer wrote

Authored by jrakibi

73/100 · Adequate
hashes: Add optimized ARM SHA256d for 64-byte input

Add the three transforms for sha256(sha256(64_bytes))

Transforms 1 & 2 compute the inner `sha256(64_bytes)`:

- Transform 1: 64 bytes already fill the first block (no
padding needed), so we apply 64 rounds of compression
normally.
After T1: state = state + initial_state

- Transform 2: the message schedule at this step is constant
and known in advance (64 bytes of padding), so
we precompute W[i]+K[i] into MIDS and apply 64 rounds (no
schedule expansion needed).
After T2: state = state + saved_T1_state
(state now contains sha256(64_bytes))

- Transform 3 computes sha256(output_of_T1_and_T2). The output
is 32 bytes, so the block contains 32 bytes and the rest is
known padding. we precompute the message
schedule for the known words (w8-w15) into FINS.
After T3: state = state + initial_state
(state now contains the sha256d result)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds a new, highly optimized way to compute a double SHA-256 hash on 64-byte inputs for 64-bit ARM processors (aarch64) using special CPU instructions. It is a pure performance improvement and does not change any public APIs or fix any known bug. There is no indication in the commit that it addresses a security vulnerability.

Recommended action

No security action required. Treat as a routine performance optimization. If reviewing for correctness, verify the precomputed MIDS/FINS/FINAL constants and the unrolled schedule updates against the SHA-256 specification and compare output against the existing software or x86_64 implementations via tests.

Security signals we found

01

New unsafe ARM SHA-256 hardware-accelerated code path added

02

Function is gated by target_arch = 'aarch64' and target_feature(enable = 'sha2')

03

No security relevance claimed by commit message or diff

04

No changes to input validation, memory allocation, or public interfaces

Risk score

Why this scored 16/100

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