Skip to content

Commit

Permalink
Add ebx to the i386 clobber list for MPI assembly
Browse files Browse the repository at this point in the history
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 Mbed-TLS#1550.
  • Loading branch information
redtangent committed Jun 24, 2018
1 parent 8266aca commit b8419f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/mbedtls/bn_mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 */
Expand Down

0 comments on commit b8419f4

Please sign in to comment.