summaryrefslogtreecommitdiffstats
path: root/vendor/sha-1-0.8.2/src/aarch64.rs
blob: d3cffecd7301b10194b65bf8b0ce0839d60e7cfa (plain)
1
2
3
4
5
6
7
8
9
// TODO: Import those from libc, see https://github.com/rust-lang/libc/pull/1638
const AT_HWCAP: u64 = 16;
const HWCAP_SHA1: u64 = 32;

#[inline(always)]
pub fn sha1_supported() -> bool {
    let hwcaps: u64 = unsafe { ::libc::getauxval(AT_HWCAP) };
    (hwcaps & HWCAP_SHA1) != 0
}