From: Milan Broz Date: Mon, 4 May 2026 14:13:27 +0000 (+0000) Subject: bn_nist.c: remove unreachable BN_BITS2 == 64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8488abc84a46dcecd4ea352f218c9aaee6f6e13f;p=thirdparty%2Fopenssl.git 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 Reviewed-by: Saša Nedvědický Reviewed-by: Eugene Syromiatnikov Reviewed-by: Neil Horman MergeDate: Thu May 7 20:11:12 2026 (Merged from https://github.com/openssl/openssl/pull/31076) --- diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c index aa084996e47..a4cea81adc4 100644 --- a/crypto/bn/bn_nist.c +++ b/crypto/bn/bn_nist.c @@ -585,9 +585,6 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, rp[6] = (unsigned int)acc; carry = (int)(acc >> 32); -#if BN_BITS2 == 64 - rp[7] = carry; -#endif } #else {