From 83868a0e455dd41ba7c70b64ae6d2cd36d066c3d Mon Sep 17 00:00:00 2001 From: Simon Butcher Date: Sun, 24 Jun 2018 12:58:31 +0100 Subject: [PATCH] Add ebx to the i386 clobber list for MPI assembly This fix adds the ebx register to the clobber list for the i386 inline assembly for the multiply helper function. ebx was used but not listed, so when the compiler chose to also use it, ebx was getting corrupted. I'm surprised this wasn't spotted sooner. Fixes Github issues #1550. --- include/mbedtls/bn_mul.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h index f4b2b561d..e04926043 100644 --- a/include/mbedtls/bn_mul.h +++ b/include/mbedtls/bn_mul.h @@ -142,7 +142,7 @@ "movl %%esi, %3 \n\t" \ : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ - : "eax", "ecx", "edx", "esi", "edi" \ + : "eax", "ebx", "ecx", "edx", "esi", "edi" \ ); #else @@ -154,7 +154,7 @@ "movl %%esi, %3 \n\t" \ : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ - : "eax", "ecx", "edx", "esi", "edi" \ + : "eax", "ebx", "ecx", "edx", "esi", "edi" \ ); #endif /* SSE2 */ #endif /* i386 */