Repository navigation
Conversation
…ound aes 0.9 enables the ARMv8 backend by default with runtime detection, so hardware AES on aarch64 no longer needs `--cfg aes_armv8` here or in downstream builds. That removes the RUSTFLAGS-override footgun where the flag in .cargo/config.toml was silently ignored. - Port to the cipher 0.5 API: GenericArray -> hybrid-array Array, BlockEncrypt -> BlockCipherEncrypt, deprecated from_slice calls -> From/TryFrom (a crate-private `block_ref` for runtime 16-byte slices). - Remove .cargo/config.toml and the README's downstream-flag caveat. - Drop the unused block-modes dependency. - Raise MSRV to 1.89 (aes 0.9.3); declare rust-version, move CI and .tool-versions to 1.89.0. rustfmt 1.89 reformats one where clause in orderable-bytes. - Update the detached ct-dudect, ct-taint and fuzz lockfiles. Ciphertexts are unchanged: the legacy, Bit6 and chained compat vectors pass byte for byte. Bit6 encrypt-u64 on aarch64 with no flags: 11.6 us, against 95 us with `--cfg aes_backend="soft"`. Closes #86
|
Converted to draft: aes 0.9.3 is 2–2.5x slower per AES call than aes 0.8.4 with The flag problem goes away, but encryption gets much slower. Measured on an Apple M4 (mains power, Low Power Mode off), Rust 1.89, criterion medians. The run went
A microbenchmark of the AES calls alone (same process, interleaved, confidence intervals under 1%):
Upstream: RustCrypto/block-ciphers#574 reported the 0.8 → 0.9 regression on x86_64. RustCrypto/block-ciphers#575 ("refactor backends") fixed it, and the fix shipped in 0.9.2. 0.9.3 is still slow on aarch64. I found no open report for aarch64. Plan: stay on aes 0.8 for ore-rs 0.9.0. A separate PR adds a check that catches builds where hardware AES is missing, which addresses the silent fallback from #86. This PR stays as a draft until upstream fixes the aarch64 path. Full write-up: |
|
The separate PR mentioned above is #108. It also contains the full write-up ( |
…arch64 fix aes 0.9.3 is 2-2.5x slower on aarch64; block-ciphers #598 fixes it but is unreleased. The patch only affects this workspace, so this PR must not be released until it's replaced by a crates.io aes release.
|
Pushed 00ef8c9: Do not merge or release this as-is. A |
Closes #86.
Summary
aes0.9 turns on the ARMv8 backend by default and detects it at runtime. That means hardware AES on aarch64 no longer needs--cfg aes_armv8, in this workspace or in downstream builds. It also removes a trap: aRUSTFLAGSenvironment variable silently overrides the flag set in.cargo/config.toml.cipher0.5 API.GenericArrayis now hybrid-array'sArray, andBlockEncryptis nowBlockCipherEncrypt. The deprecatedfrom_slicecalls are replaced withFrom/TryFrom. Runtime 16-byte slices go through a crate-privateprimitives::block_ref, which panics on a wrong length, just asfrom_slicedid..cargo/config.tomland the README's warning that downstream crates must set the flag.block-modes.aes0.9.3 needs it (0.9.1 and 0.9.2 need 1.85).rust-versionis now declared, and CI and.tool-versionsmove to 1.89.0. The new rustfmt reformats onewhereclause inorderable-bytes.ct-dudect,ct-taintandfuzzlockfiles.--cfg aes_armv8can remove it. It no longer has any effect.Verification
Run locally on Rust 1.89, aarch64, with no rustflags:
ct_benchtests pass, andclippy -D warningsandfmt --checkare clean.encrypt-u64takes 11.6 µs, against 95 µs when built with--cfg aes_backend="soft".