From 7656a373b60bb89a46c58932916c5a12cebb912f Mon Sep 17 00:00:00 2001 From: Werner Lewis Date: Mon, 13 Jun 2022 12:28:20 +0100 Subject: [PATCH] Reformat AES changes for readability Signed-off-by: Werner Lewis --- library/aes.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/aes.c b/library/aes.c index af13d6310..ca94e0a16 100644 --- a/library/aes.c +++ b/library/aes.c @@ -550,15 +550,14 @@ int mbedtls_aes_setkey_enc( mbedtls_aes_context *ctx, const unsigned char *key, } #endif + ctx->rk_offset = 0; #if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_PADLOCK_ALIGN16) if( aes_padlock_ace == -1 ) aes_padlock_ace = mbedtls_padlock_has_support( MBEDTLS_PADLOCK_ACE ); if( aes_padlock_ace ) ctx->rk_offset = MBEDTLS_PADLOCK_ALIGN16( ctx->buf ) - ctx->buf; - else #endif - ctx->rk_offset = 0; RK = ctx->buf + ctx->rk_offset; #if defined(MBEDTLS_AESNI_C) && defined(MBEDTLS_HAVE_X86_64) @@ -655,15 +654,14 @@ int mbedtls_aes_setkey_dec( mbedtls_aes_context *ctx, const unsigned char *key, mbedtls_aes_init( &cty ); + ctx->rk_offset = 0; #if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_PADLOCK_ALIGN16) if( aes_padlock_ace == -1 ) aes_padlock_ace = mbedtls_padlock_has_support( MBEDTLS_PADLOCK_ACE ); if( aes_padlock_ace ) ctx->rk_offset = MBEDTLS_PADLOCK_ALIGN16( ctx->buf ) - ctx->buf; - else #endif - ctx->rk_offset = 0; RK = ctx->buf + ctx->rk_offset; /* Also checks keybits */