• Eric Biggers's avatar
    crypto: x86/aes-xts - wire up VAES + AVX2 implementation · e787060b
    Eric Biggers authored
    Add an AES-XTS implementation "xts-aes-vaes-avx2" for x86_64 CPUs with
    the VAES, VPCLMULQDQ, and AVX2 extensions, but not AVX512 or AVX10.
    This implementation uses ymm registers to operate on two AES blocks at a
    time.  The assembly code is instantiated using a macro so that most of
    the source code is shared with other implementations.
    
    This is the optimal implementation on AMD Zen 3.  It should also be the
    optimal implementation on Intel Alder Lake, which similarly supports
    VAES but not AVX512.  Comparing to xts-aes-aesni-avx on Zen 3,
    xts-aes-vaes-avx2 provides 70% higher AES-256-XTS decryption throughput
    with 4096-byte messages, or 23% higher with 512-byte messages.
    
    A large improvement is also seen with CPUs that do support AVX512 (e.g.,
    98% higher AES-256-XTS decryption throughput on Ice Lake with 4096-byte
    messages), though the following patches add AVX512 optimized
    implementations to get a bit more performance on those CPUs.
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    e787060b
aesni-intel_glue.c 42.8 KB