Skip to content

Disable AES intrinsics on aarch64 Miri #585

Description

@nazar-pc

RustCrypto/utils#1513 had good intentions, but Miri doesn't implement many intrinsics yet. So unless you want to update cpufeatures to capture that, aes crate should not use intrinsics on aarch64 Miri, otherwise it is currently unusable there:

error: unsupported operation: can't call LLVM intrinsic `llvm.aarch64.crypto.aese` on architecture `aarch64`
    --> ~/.cache/rustup/toolchains/nightly-2026-08-25-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/arm_shared/neon/generated.rs:3247:14
     |
3247 |     unsafe { _vaeseq_u8(data, key) }
     |              ^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
     |
     = help: this means the program tried to do something Miri does not support; it does not indicate a bug in the program
     = note: this is on thread `aes::tests::test_create_verify`
     = note: stack backtrace:
             0: core::arch::aarch64::vaeseq_u8
                 at ~/.cache/rustup/toolchains/nightly-2026-08-25-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/arm_shared/neon/generated.rs:3247:14: 3247:35
             1: aes::backends::aarch64_aes::expand::sub_word
                 at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/aes-0.9.2/src/backends/aarch64_aes/expand.rs:82:21: 82:52

This specifically fails on macOS where AES capability is the default enabled feature. For Linux to hit the same +aes needs to be used, but when you do the result will be exactly the same.

P.S. Using annoying configuration flags instead of normal features for things like aes_backend means I can't work around this cleanly downstream either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions