-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport 2.x: Fix x86_64 assembly for bignum multiplication #4941
Backport 2.x: Fix x86_64 assembly for bignum multiplication #4941
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Looks good to me. |
MULADDC_CORE reads from (%%rsi) and writes to (%%rdi). This fragment is repeated up to 16 times, and %%rsi and %%rdi are s and d on entry respectively. Hence the complete asm statement reads 16 64-bit words from memory starting at s, and writes 16 64-bit words starting at d. Without any declaration of modified memory, Clang 12 and Clang 13 generated non-working code for mbedtls_mpi_mod_exp. The constraints make the unit tests pass with Clang 12. Signed-off-by: Gilles Peskine <[email protected]>
c6d977e
df33567
to
c6d977e
Compare
I fixed the register name in the commit message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This had actually been reported multiple times. Signed-off-by: Gilles Peskine <[email protected]>
184a688
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Backport of #4947