summaryrefslogtreecommitdiffstats
path: root/vendor/sha-1/src/compress/aarch64.rs
blob: 5952d1f624c773c9246dcbe28607e89da1f69c6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! SHA-1 `aarch64` backend.

// Per rustc target feature docs for `aarch64-unknown-linux-gnu` and
// `aarch64-apple-darwin` platforms, the `sha2` target feature enables
// SHA-1 as well:
//
// > Enable SHA1 and SHA256 support.
cpufeatures::new!(sha1_hwcap, "sha2");

pub fn compress(state: &mut [u32; 5], blocks: &[[u8; 64]]) {
    // TODO: Replace with https://github.com/rust-lang/rfcs/pull/2725
    // after stabilization
    if sha1_hwcap::get() {
        sha1_asm::compress(state, blocks);
    } else {
        super::soft::compress(state, blocks);
    }
}