Skip to content

ARM: fix incorrect variable names#14

Merged
noloader merged 1 commit into
noloader:masterfrom
mikowals:patch-1
Jan 7, 2026
Merged

ARM: fix incorrect variable names#14
noloader merged 1 commit into
noloader:masterfrom
mikowals:patch-1

Conversation

@mikowals
Copy link
Copy Markdown
Contributor

The ARM SHA256 functions take the state variables in simple alphabetic order, ABCD and EFGH. Documented here.

The state is ordered and use correctly only the names are wrong. So no calculations are changed.

The ARM SHA256 functions take the state variables in simple alphabetic order, ABCD and EFGH.  Documented [here](https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiesinstructiongroup=[Cryptography,SHA256])

The state is ordered and use correctly only the names are wrong.  So no calculations are changed.
@jrakibi
Copy link
Copy Markdown

jrakibi commented Jan 7, 2026

agreed, I ran into the same confusion when reading the ARM code

@noloader noloader merged commit 1e414a6 into noloader:master Jan 7, 2026
noloader added a commit that referenced this pull request Jan 8, 2026
This reverts commit 1e414a6, reversing
changes made to 4899efc.
jrakibi added a commit to jrakibi/bitcoin that referenced this pull request May 3, 2026
…HA-256 ARM intrinsics

ARM SHA256 intrinsics take state in natural order: ABCD + EFGH
(hash_abcd/hash_efgh). The code already uses that layout, only the
ABEF_SAVE/CDGH_SAVE names were wrong. Rename to ABCD_SAVE/EFGH_SAVE.
No logic change.

Docs: https://developer.arm.com/architectures/instruction-sets/intrinsics/#f:@navigationhierarchiesinstructiongroup=[Cryptography,SHA256]
Fix in original C code (Jeffrey): noloader/SHA-Intrinsics#14

-BEGIN VERIFY SCRIPT-
perl -pi -e 's/\bABEF_SAVE([AB])?\b/ABCD_SAVE$1/g' src/crypto/sha256_arm_shani.cpp
perl -pi -e 's/\bCDGH_SAVE([AB])?\b/EFGH_SAVE$1/g' src/crypto/sha256_arm_shani.cpp
-END VERIFY SCRIPT-
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.

3 participants