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

Implement assembly routines for MSVC based toolchains #326

Merged
merged 3 commits into from Oct 29, 2015
Merged

Conversation

DaGenix
Copy link
Owner

@DaGenix DaGenix commented Oct 28, 2015

Resolves issuing building with the MSVC based toolchain. The issue was that the build requires compiling some C files with inline assembly in the GCC format which is, unsurprisingly, not supported by MSVC. Additionally, MSVC doesn't support inline assembly at all on x86_64. So, the fixed time comparison and secure memory set routines have been ported to MASM assembly and the build.rs file has been updated to build those files instead of the C files with inline assembly used by GCC.

Significantly, the AES-NI implementation of AES is not ported. Any attempt to use that implementation will cause a panic!() which isn't a great solution, but its better than not compiling at all. Also, if using the functions in the aes module to dynamically pick the best AES implementation, it won't be a problem at all since the AES-NI implementation won't ever be picked when compiled for the MSVC backed targets.

In theory, this should work with the 32-bit MSVC target. However, it hasn't been tested much in this configuration. The main issue is that Rust doesn't support stack unwinding on 32-bit MSVC targets which makes the test suite fail. The 64-bit MSVC target supports unwinding and passes all tests with these changes.

Fixes #324

Palmer Cox added 3 commits October 28, 2015 00:36
… supporting assembly functions

Previously, it looks like the supporting assembly functions would access invalid memory
for zero length functions. By moving the check for 0 length requests there, its clearer
that they don't.
DaGenix added a commit that referenced this pull request Oct 29, 2015
Implement assembly routines for MSVC based toolchains
@DaGenix DaGenix merged commit a54a694 into master Oct 29, 2015
@DaGenix DaGenix deleted the msvc-asm branch October 29, 2015 01:11
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

Successfully merging this pull request may close these issues.

rust-crypto doesn't build on x86_64-pc-windows-msvc
1 participant