1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00

Fix merge errors in backporting

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove
2023-03-17 16:54:59 +00:00
parent 9494a99c2f
commit 58550acba0

View File

@@ -693,17 +693,6 @@ int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
goto exit;
}
#endif
#if defined(MBEDTLS_AESNI_HAVE_CODE)
if (mbedtls_aesni_has_support(MBEDTLS_AESNI_AES)) {
/* The intrinsics-based implementation needs 16-byte alignment
* for the round key array. */
unsigned delta = (uintptr_t) ctx->buf & 0x0000000f;
if (delta != 0) {
size_t rk_offset = 4 - delta / 4; // 16 bytes = 4 uint32_t
ctx->rk = RK = ctx->buf + rk_offset;
}
}
#endif
SK = cty.rk + cty.nr * 4;
@@ -1016,9 +1005,6 @@ void mbedtls_aes_decrypt(mbedtls_aes_context *ctx,
*/
static void aes_maybe_realign(mbedtls_aes_context *ctx)
{
/* We want a 16-byte alignment. Note that rk and buf are pointers to uint32_t
* and offset is in units of uint32_t words = 4 bytes. We want a
* 4-word alignment. */
unsigned current_offset = (unsigned)(ctx->rk - ctx->buf);
unsigned new_offset = mbedtls_aes_rk_offset(ctx->buf);
if (new_offset != current_offset) {