Fix merge errors in backporting
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
diff --git a/library/aes.c b/library/aes.c
index d7e4a7c..0ab3ea7 100644
--- a/library/aes.c
+++ b/library/aes.c
@@ -693,17 +693,6 @@
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 @@
*/
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) {