]> git.ipfire.org Git - thirdparty/openssl.git/commit
bn_nist.c: remove unreachable BN_BITS2 == 64
authorMilan Broz <gmazyland@gmail.com>
Mon, 4 May 2026 14:13:27 +0000 (14:13 +0000)
committerNeil Horman <nhorman@openssl.org>
Thu, 7 May 2026 20:10:50 +0000 (16:10 -0400)
commit8488abc84a46dcecd4ea352f218c9aaee6f6e13f
tree99fbca599cf4b5c562ec96359b6a2c673bd3c98f
parentb391338239f2c3d46e5e9a83f08f4ec6e57fcd70
bn_nist.c: remove unreachable BN_BITS2 == 64

The block in BN_nist_mod_224() is gated by

  #if defined(NIST_INT64) && BN_BITS2 != 64

so the #if

  #if BN_BITS2 == 64
          rp[7] = carry;
  #endif

is unreachable. Remove it.

The code is actualy relic of an earlier design where the NIST_INT64
accumulator path was meant 64-bit too.

Disabling 64-bit path above with BN_BITS2 != 64 resulted in
#if BN_BITS2 == 64 was left unreachable

The outer condition is correct, it is meant to be 32bit only,
otherwise it would need to introduce load_u32/store_lo32 as in other
functions to avoid clang strict-aliasing optimizer issues.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May  7 20:11:12 2026
(Merged from https://github.com/openssl/openssl/pull/31076)
crypto/bn/bn_nist.c