crypto/bn/bn_gf2m.c: optimize ossl_(un)likely

Signed-off-by: Norbert Pocs <norbertp@openssl.org>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)
This commit is contained in:
Norbert Pocs 2025-07-03 15:53:31 +02:00 committed by Neil Horman
parent d1facb4858
commit d083024b73
1 changed files with 2 additions and 2 deletions

View File

@ -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;