From 4393dff8ca0c42e89f92897e2a7333f9daaa82e3 Mon Sep 17 00:00:00 2001 From: Solar Designer Date: Sun, 8 Dec 2024 18:55:53 +0100 Subject: [PATCH] Specify previously missed XMM register clobbers in AES-NI asm blocks Noticed by Gilles Peskine Co-authored-by: Gilles Peskine Signed-off-by: Solar Designer --- tf-psa-crypto/drivers/builtin/src/aesni.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tf-psa-crypto/drivers/builtin/src/aesni.c b/tf-psa-crypto/drivers/builtin/src/aesni.c index 69fe9e52b3cc..4fc1cb918bac 100644 --- a/tf-psa-crypto/drivers/builtin/src/aesni.c +++ b/tf-psa-crypto/drivers/builtin/src/aesni.c @@ -679,7 +679,7 @@ static void aesni_setkey_enc_128(unsigned char *rk, AESKEYGENA(xmm0_xmm1, "0x36") "call 1b \n\t" : : "r" (rk), "r" (key) - : "memory", "cc", "0"); + : "memory", "cc", "xmm0", "xmm1", "0"); } /* @@ -737,7 +737,7 @@ static void aesni_setkey_enc_192(unsigned char *rk, : : "r" (rk), "r" (key) - : "memory", "cc", "0"); + : "memory", "cc", "xmm0", "xmm1", "xmm2", "0"); } #endif /* !MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH */ @@ -805,7 +805,7 @@ static void aesni_setkey_enc_256(unsigned char *rk, AESKEYGENA(xmm1_xmm2, "0x40") "call 1b \n\t" : : "r" (rk), "r" (key) - : "memory", "cc", "0"); + : "memory", "cc", "xmm0", "xmm1", "xmm2", "0"); } #endif /* !MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH */