block-ciphers icon indicating copy to clipboard operation
block-ciphers copied to clipboard

aes: use stabilized AVX-512 intrinsics

Open tarcieri opened this issue 6 months ago • 2 comments

Rust 1.89 beta is now out and includes initial stabilizations of AVX-512 target features: https://github.com/rust-lang/rust/pull/138940

cc @silvanshade

tarcieri avatar Jun 27 '25 15:06 tarcieri

As I wrote in the implementation PR, I think we should release v0.9.0 with AVX-512 support gated behind an unstable configuration flag to preserve the 1.85 MSRV and then release v0.9.1 with proper support and MSRV 1.89.

newpavlov avatar Jun 27 '25 19:06 newpavlov

Good to know. I'll take a look and submit a follow up PR.

I don't have strong opinions about gating support behind a feature flag.

Currently it's only enabled if compiling with a sufficiently recent and explicit CPU target which means they probably would intend to take advantage of such features if they existed. I'm not sure we need an additional layer beyond that to enable it.

silvanshade avatar Jun 28 '25 01:06 silvanshade

Opened #490 to use 1.89.0-beta.2 for VAES CI

tarcieri avatar Jul 02 '25 15:07 tarcieri

Re: cfg gating, I think the current gating is fine but we should definitely call it out the feature as experimental/unstable and note it may change in future releases of the crate, even for future aes v0.9 releases.

Ideally we could get autodetection of the feature working, but also keep that gated behind a custom cfg for now, at least until we're confident in enabling it by default.

tarcieri avatar Jul 02 '25 15:07 tarcieri