1 #![cfg(feature = "asm-aarch64")]
2 use libc
::{getauxval, AT_HWCAP, HWCAP_SHA1}
;
4 fn sha1_supported() -> bool
{
6 let hwcaps
: u64 = unsafe { getauxval(AT_HWCAP) }
;
7 (hwcaps
& HWCAP_SHA1
) != 0
10 pub fn compress(state
: &mut [u32; 5], blocks
: &[u8; 64]) {
11 // TODO: Replace this platform-specific call with is_aarch64_feature_detected!("sha1") once
12 // that macro is stabilised and https://github.com/rust-lang/rfcs/pull/2725 is implemented
13 // to let us use it on no_std.
16 sha1_asm
::compress(state
, block
);
19 super::soft
::compress(state
, blocks
);