From 6bd1a6d0abb20b6051ef1109b0ad073b67242a89 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 13 Nov 2022 20:56:27 -0700 Subject: [PATCH] keccak: rename `f1600_armv8_sha3_asm` (#26) Include the target architecture and feature in the name of the function. --- keccak/README.md | 4 ++-- keccak/src/armv8.rs | 2 +- keccak/src/lib.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keccak/README.md b/keccak/README.md index 83cf851..dcd323f 100644 --- a/keccak/README.md +++ b/keccak/README.md @@ -22,7 +22,7 @@ is built on this crate. ## Minimum Supported Rust Version -Rust **1.41** or higher. +Rust **1.41** or higher by default, or **1.59** with the `asm` feature enabled. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -63,4 +63,4 @@ dual licensed as above, without any additional terms or conditions. [//]: # (general links) [1]: https://keccak.team/keccak.html -[`sha3`]: https://github.com/RustCrypto/hashes/tree/master/sha3 \ No newline at end of file +[`sha3`]: https://github.com/RustCrypto/hashes/tree/master/sha3 diff --git a/keccak/src/armv8.rs b/keccak/src/armv8.rs index 88e756c..44ed7ec 100644 --- a/keccak/src/armv8.rs +++ b/keccak/src/armv8.rs @@ -4,7 +4,7 @@ /// Adapted from the Keccak-f1600 implementation in the XKCP/K12. /// see #[target_feature(enable = "sha3")] -pub unsafe fn f1600_asm(state: &mut [u64; 25]) { +pub unsafe fn f1600_armv8_sha3_asm(state: &mut [u64; 25]) { core::arch::asm!(" // Read state ld1.1d {{ v0- v3}}, [x0], #32 diff --git a/keccak/src/lib.rs b/keccak/src/lib.rs index 8761140..381f2ff 100644 --- a/keccak/src/lib.rs +++ b/keccak/src/lib.rs @@ -53,7 +53,7 @@ mod unroll; mod armv8; #[cfg(all(target_arch = "aarch64", feature = "asm"))] -pub use armv8::f1600_asm; +pub use armv8::f1600_armv8_sha3_asm; #[cfg(all(target_arch = "aarch64", feature = "asm"))] cpufeatures::new!(armv8_sha3_intrinsics, "sha3"); @@ -159,7 +159,7 @@ impl_keccak!(f1600, u64); #[cfg(all(target_arch = "aarch64", feature = "asm"))] pub fn f1600(state: &mut [u64; PLEN]) { if armv8_sha3_intrinsics::get() { - unsafe { f1600_asm(state) } + unsafe { f1600_armv8_sha3_asm(state) } } else { keccak_p(state, u64::KECCAK_F_ROUND_COUNT); }