From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/sha-1/src/compress/aarch64.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 vendor/sha-1/src/compress/aarch64.rs (limited to 'vendor/sha-1/src/compress/aarch64.rs') diff --git a/vendor/sha-1/src/compress/aarch64.rs b/vendor/sha-1/src/compress/aarch64.rs new file mode 100644 index 000000000..5952d1f62 --- /dev/null +++ b/vendor/sha-1/src/compress/aarch64.rs @@ -0,0 +1,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); + } +} -- cgit v1.2.3