Skip to content

Commit 0945c16

Browse files
committed
add #[target_feature(enable = "sha3")] for the ARM backend
1 parent 0e0fb30 commit 0945c16

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

keccak/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ impl Keccak {
5656
pub fn with_backend(&self, f: impl BackendClosure) {
5757
#[cfg(target_arch = "aarch64")]
5858
if self.armv8_sha3.get() {
59-
// TODO: impl ARM backend
60-
return f.call_once::<SoftBakend>();
59+
#[target_feature(enable = "sha3")]
60+
fn aarch64_sha3_inner(f: impl BackendClosure) {
61+
// TODO: impl arm backend
62+
f.call_once::<SoftBakend>();
63+
}
64+
// SAFETY: we checked target feature availability above
65+
return unsafe { aarch64_sha3_inner(f) };
6166
}
6267
f.call_once::<SoftBakend>();
6368
}

0 commit comments

Comments
 (0)