You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and packages/ore-rs/README.md tells downstream crates they must set the
same flag in their own build config or they silently fall back to the ~60x
slower software (fixslice) backend.
A code review of #80 flagged that this is fragile: rustflags in .cargo/config.toml is silently ignored if a RUSTFLAGS env var is set
(common in CI/Docker/dev shells), so hardware AES can vanish with no error.
The fix: upgrade aes 0.8 → 0.9
aes 0.9 removes the aes_armv8 cfg entirely. The ARMv8 backend is now #[cfg(all(target_arch = "aarch64", not(aes_backend = "soft")))] — enabled by
default, with runtime autodetection via cpufeatures on Linux/macOS
(CHANGELOG 0.9.0: "Enable ARMv8 backend by default", "Replace inline ASM with
ARMv8 intrinsics"). The opt-out is now --cfg aes_backend="soft".
Upgrading lets us:
delete .cargo/config.toml's aes_armv8 rustflags,
drop the downstream "set this flag too" caveat in the README,
eliminate the RUSTFLAGS-override footgun,
get hardware AES on aarch64 for downstream consumers automatically.
API churn: 0.8→0.9 bumps the RustCrypto cipher trait generation; check Aes128::new / encrypt_block(s) / GenericArray usages in primitives/
and the block-modes/other RustCrypto deps for version unification.
zeroize feature: confirm aes 0.9 still exposes the zeroize feature
and that aes::Aes128: ZeroizeOnDrop still holds — the ZA-0001 fix (fix(prp): zeroize Aes128Prng keystream on drop (ZA-0001) #84) adds
a compile-time assert that depends on it, so the assert will catch a
regression but we should expect it to still pass.
Wire format: AES output is unchanged, so the pinned compat vectors must
still pass byte-for-byte (good regression gate for the bump).
Background
The crate currently depends on
aes = 0.8.4and ships a workaround so ARMv8hardware AES is used on aarch64:
.cargo/config.tomlsetsrustflags = ["--cfg", "aes_armv8"]forcfg(target_arch = "aarch64")(added in PR ORE v2 (3/n): efficient unary encoding + hardware AES on aarch64 #80),packages/ore-rs/README.mdtells downstream crates they must set thesame flag in their own build config or they silently fall back to the ~60x
slower software (fixslice) backend.
A code review of #80 flagged that this is fragile:
rustflagsin.cargo/config.tomlis silently ignored if aRUSTFLAGSenv var is set(common in CI/Docker/dev shells), so hardware AES can vanish with no error.
The fix: upgrade
aes0.8 → 0.9aes0.9 removes theaes_armv8cfg entirely. The ARMv8 backend is now#[cfg(all(target_arch = "aarch64", not(aes_backend = "soft")))]— enabled bydefault, with runtime autodetection via
cpufeatureson Linux/macOS(CHANGELOG 0.9.0: "Enable ARMv8 backend by default", "Replace inline ASM with
ARMv8 intrinsics"). The opt-out is now
--cfg aes_backend="soft".Upgrading lets us:
.cargo/config.toml'saes_armv8rustflags,Scope / caveats (this is a breaking dep bump)
ciphertrait generation; checkAes128::new/encrypt_block(s)/GenericArrayusages inprimitives/and the
block-modes/other RustCrypto deps for version unification.zeroizefeature: confirmaes0.9 still exposes thezeroizefeatureand that
aes::Aes128: ZeroizeOnDropstill holds — the ZA-0001 fix (fix(prp): zeroize Aes128Prng keystream on drop (ZA-0001) #84) addsa compile-time assert that depends on it, so the assert will catch a
regression but we should expect it to still pass.
still pass byte-for-byte (good regression gate for the bump).
Acceptance
aesbumped to 0.9.x;.cargo/config.tomlaes_armv8 rustflags removed;README downstream-flag caveat removed.
cargo test(incl. compat vectors) + clippy-D warningsgreen.