return GNUTLS_E_MEMORY_ERROR;
}
- if (encr_size - tag_size < plain_size) {
+ if (unlikely(encr_size - tag_size < plain_size)) {
ret = GNUTLS_E_SHORT_MEMORY_BUFFER;
gnutls_assert();
goto end;
/* the GCM in kernel will place the tag after the
* encrypted data.
*/
- if (dst_size - GCM_BLOCK_SIZE < src_size)
+ if (unlikely(dst_size - GCM_BLOCK_SIZE < src_size))
return gnutls_assert_val(GNUTLS_E_SHORT_MEMORY_BUFFER);
ctx->cryp.len = src_size;
ctx->cryp.auth_len = ctx->auth_data_size;
ctx->cryp.auth_src = ctx->auth_data;
- if (dst_size < src_size - GCM_BLOCK_SIZE)
+ if (unlikely(dst_size < src_size - GCM_BLOCK_SIZE))
return gnutls_assert_val(GNUTLS_E_SHORT_MEMORY_BUFFER);
if (ioctl(ctx->cfd, CIOCAUTHCRYPT, &ctx->cryp)) {