Skip to content

Autodetection of AES-NI #427

@smessmer

Description

@smessmer

Currently, it seems the library requires explicit RUSTFLAGS to use AES-NI. This is easy to get wrong. It would be much better to autodetect it. Crates like aes successfully use runtime detection of the aes-ni instruction set.

As a related question, the recommended flags are

RUSTFLAGS="-Ctarget-cpu=sandybridge -Ctarget-feature=+aes,+sse2,+sse4.1,+ssse3"

Shouldn't the aes,sse2,sse4.1,ssse3 flags be automatically set on CPUs that support it? Why do we need to specify them manually? If they're automatically set, shouldn't that already be enough to enable the AESNI instruction set without even requiring runtime detection?

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