Skip to content
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

64x64->64 muls are not constant-time with MSVC on 32bit x86 #1164

Open
real-or-random opened this issue Dec 1, 2022 · 0 comments
Open

64x64->64 muls are not constant-time with MSVC on 32bit x86 #1164

real-or-random opened this issue Dec 1, 2022 · 0 comments

Comments

@real-or-random
Copy link
Contributor

From PR #711, which has been closed:

The issue is that MSVC for 32-bit targets implements 64x64->64 bit multiplications using a non-constant subroutine. The subroutine is not constant-time because it shortcuts when the high 32 bits of both multiplicands are all 0. See research.kudelskisecurity.com/2017/01/16/when-constant-time-source-may-not-save-you and also bearssl.org/ctmul.html for a broader view of the issue.

I'm opening this GitHub issue here because the underlying issue hasn't been solved. (And I've checked the compiler explorer, the issue is still present on the latest msvc...)

After #1000 and #1156, this is (much?) less severe because we now support 64-bit targets on MSVC, and MSVC produces proper constant-time muls for those targets, it just outputs imul.

The best solution is probably #815.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant