Skip to content

sha2: enable asm for hardware SHA-256 with runtime detection - #78

Draft
b7r6 wants to merge 1 commit into
mainfrom
pr/sha2-asm
Draft

b7r6 wants to merge 1 commit into
mainfrom
pr/sha2-asm

Conversation

@b7r6

@b7r6 b7r6 commented Oct 22, 2026

Copy link
Copy Markdown
Owner

What and why

sha2: enable asm — hardware SHA-256 with runtime detection

RustCrypto gates the aarch64 hardware SHA-2 backend behind the asm
feature; enabling it pulls sha2-asm (cc-compiled) and, via cpufeatures,
runtime-detects the HWCAP sha2 bit. One binary then uses on-core
hardware SHA-256 where present and the software path elsewhere.
Digest hashing is a hot path for the CAS.

How was this verified?

The branch's own tests, run with Bazel on railgun today after the rebase onto upstream b01417643e; CI on this PR is the first automated run.

Also part of the soak branch (#73): upstream HEAD plus every pending fix, run through the railgun fleet for an hour of continuous remote builds with no errors.

Risk

Adds sha2-asm (cc-compiled) to the build; runtime detection via cpufeatures keeps the software path on cores without SHA-2 extensions. MODULE.bazel.lock carries the new crate.

AI assistance

Written with Claude Code; b7r6 reviewed the change. Draft until the author has read the CI results.

🤖 Generated with Claude Code

RustCrypto gates the aarch64 hardware SHA-2 backend behind the `asm`
feature; enabling it pulls sha2-asm (cc-compiled) and, via cpufeatures,
runtime-detects the HWCAP sha2 bit. One binary then uses on-core
hardware SHA-256 where present and the software path elsewhere.
Digest hashing is a hot path for the CAS.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant