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

Allow compile-time detection of crypto extension on AArch64 #104

Merged
merged 1 commit into from Mar 1, 2020

Conversation

linkmauve
Copy link
Contributor

@linkmauve linkmauve commented Feb 27, 2020

The existing way depends on the libc crate, only works on Linux, and does a getauxval() call each 64 bytes of input.

This commit adds support for doing this detection at compile-time, if the "crypto" target_feature is enabled we can use the same code-path as amd64 and reuse the asm feature. It should also work on non-Linux target_os, but this is untested.

A new compile_error!() has been added helping users figure out the best way to build this crate.

Benchmarks don’t seem to change much without the getauxval() call, they’re all within error range.

The existing way depends on the libc crate, only works on Linux, and
does a getauxval() call each 64 bytes of input.

This commit adds support for doing this detection at compile-time, if
the target_feature crypto is enabled we can use the same code-path as
amd64 and reuse the asm feature.

A new compile_error!() has been added helping users figure out the best
way to build this crate.
@linkmauve linkmauve force-pushed the compile-time-aarch64-crypto branch 3 times, most recently from 9ba4c10 to 3f9b926 Compare February 28, 2020 00:26
@tarcieri tarcieri merged commit 87d1cb0 into RustCrypto:master Mar 1, 2020
@tarcieri
Copy link
Member

tarcieri commented Mar 1, 2020

Thanks!

@linkmauve linkmauve deleted the compile-time-aarch64-crypto branch March 1, 2020 01:20
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.

None yet

2 participants