• Eric Biggers's avatar
    crypto: x86/aes-xts - handle AES-128 and AES-192 more efficiently · 2717e01f
    Eric Biggers authored
    Decrease the amount of code specific to the different AES variants by
    "right-aligning" the sequence of round keys, and for AES-128 and AES-192
    just skipping irrelevant rounds at the beginning.
    
    This shrinks the size of aes-xts-avx-x86_64.o by 13.3%, and it improves
    the efficiency of AES-128 and AES-192.  The tradeoff is that for AES-256
    some additional not-taken conditional jumps are now executed.  But these
    are predicted well and are cheap on x86.
    
    Note that the ARMv8 CE based AES-XTS implementation uses a similar
    strategy to handle the different AES variants.
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    2717e01f
aes-xts-avx-x86_64.S 25.8 KB