RustCrypto / hashes

Collection of cryptographic hash functions written in pure Rust
1.89k stars 257 forks source link

sha2: use ARM intrinsics rather than ASM #571

Closed tarcieri closed 4 weeks ago

tarcieri commented 8 months ago

As of Rust 1.76, the SHA-256 NEON intrinsics are stable, but the SHA-512 ones are not. See tracking issue here: https://github.com/rust-lang/rust/issues/117225

We currently use asm! for both algorithms to "emulate" the relevant unstable intrinsics.

It probably doesn't make sense to switch only SHA-256 to the intrinsics, which would necessitate what's currently an aggressive MSRV bump to 1.76, but wouldn't completely get rid of the asm!.

When the SHA-512 intrinsics have been stabilized and we're ready to bump MSRV, we can migrate both implementations.

tarcieri commented 8 months ago

This PR stabilizes the SHA-512 intrinsics: https://github.com/rust-lang/stdarch/pull/1552

newpavlov commented 4 weeks ago

Done in #607