Implement assembly routines for MSVC based toolchains #326
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theaes
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