1 // TODO: Import those from libc, see https://github.com/rust-lang/libc/pull/1638
2 const AT_HWCAP: u64 = 16;
3 const HWCAP_SHA1: u64 = 32;
4 
5 #[inline(always)]
sha1_supported() -> bool6 pub fn sha1_supported() -> bool {
7     let hwcaps: u64 = unsafe { ::libc::getauxval(AT_HWCAP) };
8     (hwcaps & HWCAP_SHA1) != 0
9 }
10