Skip to content

Commit

Permalink
Merge pull request #4941 from gilles-peskine-arm/muladdc-amd64-memory…
Browse files Browse the repository at this point in the history
…-2.x

Backport 2.x: Fix x86_64 assembly for bignum multiplication
  • Loading branch information
gilles-peskine-arm authored Sep 20, 2021
2 parents 3c0f304 + 184a688 commit 02e17c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.d/muladdc-amd64-memory.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Bugfix
* Fix missing constraints on x86_64 assembly code for bignum multiplication
that broke some bignum operations with (at least) Clang 12.
Fixes #4116, #4786, #4917.
6 changes: 3 additions & 3 deletions include/mbedtls/bn_mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@
"addq $8, %%rdi\n"

#define MULADDC_STOP \
: "+c" (c), "+D" (d), "+S" (s) \
: "b" (b) \
: "rax", "rdx", "r8" \
: "+c" (c), "+D" (d), "+S" (s), "+m" (*(uint64_t (*)[16]) d) \
: "b" (b), "m" (*(const uint64_t (*)[16]) s) \
: "rax", "rdx", "r8" \
);

#endif /* AMD64 */
Expand Down

0 comments on commit 02e17c0

Please sign in to comment.