Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keccak: rename f1600_armv8_sha3_asm #26

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions keccak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
[`sha3`]: https://github.com/RustCrypto/hashes/tree/master/sha3
2 changes: 1 addition & 1 deletion keccak/src/armv8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Adapted from the Keccak-f1600 implementation in the XKCP/K12.
/// see <https://github.com/XKCP/K12/blob/df6a21e6d1f34c1aa36e8d702540899c97dba5a0/lib/ARMv8Asha3/KeccakP-1600-ARMv8Asha3.S#L69>
#[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
Expand Down
4 changes: 2 additions & 2 deletions keccak/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
}
Expand Down