crypto: fix incorrect variable names in SHA-256 ARM intrinsics #34537

pull jrakibi wants to merge 1 commits into bitcoin:master from jrakibi:fix-sha256-arm-variable-names changing 1 files +14 −14
  1. jrakibi commented at 9:37 am on February 9, 2026: contributor

    ARM SHA256 intrinsics take state in natural order: ABCD + EFGH (hash_abcd/hash_efgh). Documented here The code already uses that layout, only the ABEF_SAVE/CDGH_SAVE names were wrong. 


    Rename to ABCD_SAVE/EFGH_SAVE. No logic change. Fix in original C code (Jeffrey): https://github.com/noloader/SHA-Intrinsics/pull/14

  2. crypto: fix incorrect variable names in SHA-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): https://github.com/noloader/SHA-Intrinsics/pull/14
    254f32b00c
  3. DrahtBot added the label Utils/log/libs on Feb 9, 2026
  4. DrahtBot commented at 9:37 am on February 9, 2026: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK l0rinc

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  5. l0rinc approved
  6. l0rinc commented at 11:25 am on February 9, 2026: contributor

    Concept ACK.

    Based on the description and the code path, this looks correct: STATE0 maps to s[0..3] (vld1q_u32(ptr) loads 4 consecutive lanes according to the docs) (and STATE1 is similar), so ABCD_SAVE / EFGH_SAVE is semantically aligned. I checked other projects (e.g. https://botan.randombit.net/doxygen/sha1__armv8_8cpp_source.html#l00037) and did a compared the local binary and this appears to be a correct rename-only clarity fix with no logic change.


    Consider keeping the scripted rename split into two explicit substitutions to make review simpler, e.g.

    • 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

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-02-10 18:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me