size_t soutl, inl_ = (size_t)inl;
int blocksize;
- if (likely(outl != NULL)) {
+ if (ossl_likely(outl != NULL)) {
*outl = 0;
} else {
ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
}
/* Prevent accidental use of decryption context when encrypting */
- if (unlikely(!ctx->encrypt)) {
+ if (ossl_unlikely(!ctx->encrypt)) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
return 0;
}
- if (unlikely(ctx->cipher == NULL)) {
+ if (ossl_unlikely(ctx->cipher == NULL)) {
ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
return 0;
}
- if (unlikely(ctx->cipher->prov == NULL))
+ if (ossl_unlikely(ctx->cipher->prov == NULL))
goto legacy;
blocksize = ctx->cipher->block_size;
- if (unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
+ if (ossl_unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
return 0;
}
inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
in, inl_);
- if (likely(ret)) {
+ if (ossl_likely(ret)) {
if (soutl > INT_MAX) {
ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
return 0;
size_t soutl, inl_ = (size_t)inl;
int blocksize;
- if (likely(outl != NULL)) {
+ if (ossl_likely(outl != NULL)) {
*outl = 0;
} else {
ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
}
/* Prevent accidental use of encryption context when decrypting */
- if (unlikely(ctx->encrypt)) {
+ if (ossl_unlikely(ctx->encrypt)) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
return 0;
}
- if (unlikely(ctx->cipher == NULL)) {
+ if (ossl_unlikely(ctx->cipher == NULL)) {
ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
return 0;
}
- if (unlikely(ctx->cipher->prov == NULL))
+ if (ossl_unlikely(ctx->cipher->prov == NULL))
goto legacy;
blocksize = EVP_CIPHER_CTX_get_block_size(ctx);
- if (unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
+ if (ossl_unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
return 0;
}
inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
in, inl_);
- if (likely(ret)) {
+ if (ossl_likely(ret)) {
if (soutl > INT_MAX) {
ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
return 0;
*err = 0;
return 0;
}
- if (unlikely(upper == 1))
+ if (ossl_unlikely(upper == 1))
return 0;
/* Get 32 bits of entropy */
prod = (uint64_t)upper * rand;
i = prod >> 32;
f = prod & 0xffffffff;
- if (likely(f <= 1 + ~upper)) /* 1+~upper == -upper but compilers whine */
+ if (ossl_likely(f <= 1 + ~upper)) /* 1+~upper == -upper but compilers whine */
return i;
/*
if (f < f2)
return i + 1;
/* For not all 1 bits, there is no carry so return the result */
- if (likely(f != 0xffffffff))
+ if (ossl_likely(f != 0xffffffff))
return i;
/* setup for the next word of randomness */
f = prod & 0xffffffff;
# include "internal/nelem.h"
# if defined(__GNUC__) || defined(__clang__)
-# define likely(x) __builtin_expect(!!(x), 1)
-# define unlikely(x) __builtin_expect(!!(x), 0)
+# define ossl_likely(x) __builtin_expect(!!(x), 1)
+# define ossl_unlikely(x) __builtin_expect(!!(x), 0)
# else
-# define likely(x) x
-# define unlikely(x) x
+# define ossl_likely(x) x
+# define ossl_unlikely(x) x
# endif
# if defined(__GNUC__) || defined(__clang__)
# endif
# ifdef NDEBUG
-# define ossl_assert(x) likely((x) != 0)
+# define ossl_assert(x) ossl_likely((x) != 0)
# else
__owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr,
const char *file, int line)