mirror of https://github.com/openssl/openssl.git
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:
parent
d1facb4858
commit
d083024b73
|
@ -344,7 +344,7 @@ int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])
|
||||||
d0 = p[0] % BN_BITS2;
|
d0 = p[0] % BN_BITS2;
|
||||||
d1 = BN_BITS2 - d0;
|
d1 = BN_BITS2 - d0;
|
||||||
z[j - n] ^= (zz >> d0);
|
z[j - n] ^= (zz >> d0);
|
||||||
if (d0)
|
if (ossl_likely(d0))
|
||||||
z[j - n - 1] ^= (zz << d1);
|
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;
|
d1 = BN_BITS2 - d0;
|
||||||
|
|
||||||
/* clear up the top d1 bits */
|
/* clear up the top d1 bits */
|
||||||
if (d0)
|
if (ossl_likely(d0))
|
||||||
z[dN] = (z[dN] << d1) >> d1;
|
z[dN] = (z[dN] << d1) >> d1;
|
||||||
else
|
else
|
||||||
z[dN] = 0;
|
z[dN] = 0;
|
||||||
|
|
Loading…
Reference in New Issue