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

sha2: fix aarch64 implementation being disabled #569

Merged
merged 1 commit into from Mar 12, 2024

Conversation

enkore
Copy link
Contributor

@enkore enkore commented Mar 12, 2024

Fixes #568

(eref 42d478fb6976)

@tarcieri tarcieri merged commit 1f79203 into RustCrypto:master Mar 12, 2024
22 checks passed
@tarcieri
Copy link
Member

Thanks!

@enkore
Copy link
Contributor Author

enkore commented Mar 12, 2024

works quite well, too: on a GH200 the aarch64.rs code runs at 1.7 GiB/s (versus 0.4 GiB/s for the soft implementation), OpenSSL 3 is just shy of 2 GiB/s.

@enkore enkore deleted the sha2-fix-aarch64 branch March 12, 2024 15:10
@tarcieri
Copy link
Member

We can probably switch from inline ASM back to the intrinsics at this point, given the current MSRV

@enkore
Copy link
Contributor Author

enkore commented Mar 12, 2024

Looks like these only landed in 1.76: https://doc.rust-lang.org/core/arch/aarch64/fn.vsha256su0q_u32.html

@tarcieri
Copy link
Member

I couldn't even get them to work on 1.76, despite the documentation making it look like they should work: https://github.com/RustCrypto/hashes/actions/runs/8251432049/job/22568457459

@tarcieri
Copy link
Member

Oh, perhaps the SHA-256 intrinsics were stabilized, but the SHA-512 ones weren't?

@enkore
Copy link
Contributor Author

enkore commented Mar 12, 2024

Looks like it, that's a bit odd.

@tarcieri
Copy link
Member

tarcieri commented Mar 12, 2024

Here's the stabilization PR: https://github.com/rust-lang/stdarch/pull/1399/files

I don't even see where e.g. vsha512h2q_u64 is defined? Edit: aha, here it is:

https://github.com/rust-lang/stdarch/blob/3961d3b/crates/core_arch/src/aarch64/neon/generated.rs#L15274-L15288

Gated under stdarch_neon_sha3. Tracking issue here: rust-lang/rust#117225

@tarcieri
Copy link
Member

Opened #571 to track this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sha2: aarch64 acceleration broken on master
2 participants