-
Notifications
You must be signed in to change notification settings - Fork 735
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
Enable SHA512 acceleration on Aarch4 Android, Linux, and Apple targets. #1978
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1978 +/- ##
==========================================
- Coverage 96.29% 96.28% -0.01%
==========================================
Files 136 137 +1
Lines 20677 20723 +46
Branches 226 226
==========================================
+ Hits 19910 19954 +44
- Misses 732 735 +3
+ Partials 35 34 -1 ☔ View full report in Codecov by Sentry. |
cc782fe
to
87b7687
Compare
75d071b
to
41651bc
Compare
} | ||
debug_assert_eq!(len, mem::size_of_val(&value)); | ||
if len != mem::size_of_val(&value) { | ||
return false; |
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.
Hmm...why is codecov telling me that this line is being hit?
let rc = unsafe { libc::sysctlbyname(name, value_ptr, &mut len, core::ptr::null_mut(), 0) }; | ||
// All the conditions are separated so we can observe them in code coverage. | ||
if rc != 0 { | ||
return false; |
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.
I don't understand why codecov is saying this is being hit.
1bb7778
to
5cd744a
Compare
fn getauxval(type_: c_ulong) -> c_ulong; | ||
cfg_if::cfg_if! { | ||
if #[cfg(target_arch = "aarch64")] { | ||
use libc::{getauxval,AT_HWCAP, HWCAP_AES, HWCAP_PMULL, HWCAP_SHA2, HWCAP_SHA512}; |
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.
Tested on M1 and time consumed by sha512 is reduced to half.
Make it easy to test the dynamic detection for other aarch64-apple-* targets.
Use the `libc` crate so we don't have to maintain the binding for `sysctlbyname`, and so `libc` will take care of the linking to libc as needed.. Wrap `sysctlbyname` in a safe wrapper. Separate the branches for the `sysctlbyname` results so we can see them individually in code coverage.
5cd744a
to
49add64
Compare
No description provided.