From: Norbert Pocs Date: Thu, 3 Jul 2025 13:53:31 +0000 (+0200) Subject: crypto/bn/bn_gf2m.c: optimize ossl_(un)likely X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d083024b733ab8d406d2630338bd1363259f732b;p=thirdparty%2Fopenssl.git crypto/bn/bn_gf2m.c: optimize ossl_(un)likely Signed-off-by: Norbert Pocs Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27961) --- diff --git a/crypto/bn/bn_gf2m.c b/crypto/bn/bn_gf2m.c index ae7e9d751c2..666c7bef03c 100644 --- a/crypto/bn/bn_gf2m.c +++ b/crypto/bn/bn_gf2m.c @@ -344,7 +344,7 @@ int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]) d0 = p[0] % BN_BITS2; d1 = BN_BITS2 - d0; z[j - n] ^= (zz >> d0); - if (d0) + if (ossl_likely(d0)) z[j - n - 1] ^= (zz << d1); } @@ -358,7 +358,7 @@ int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]) d1 = BN_BITS2 - d0; /* clear up the top d1 bits */ - if (d0) + if (ossl_likely(d0)) z[dN] = (z[dN] << d1) >> d1; else z[dN] = 0;