• Ard Biesheuvel's avatar
    crypto: arm64/aes-neonbs-xts - use plain NEON for non-power-of-2 input sizes · dfc6031e
    Ard Biesheuvel authored
    Even though the kernel's implementations of AES-XTS were updated to
    implement ciphertext stealing and can operate on inputs of any size
    larger than or equal to the AES block size, this feature is rarely used
    in practice.
    
    In fact, in the kernel, AES-XTS is only used to operate on 4096 or 512
    byte blocks, which means that not only the ciphertext stealing is
    effectively dead code, the logic in the bit sliced NEON implementation
    to deal with fewer than 8 blocks at a time is also never used.
    
    Since the bit-sliced NEON driver already depends on the plain NEON
    version, which is slower but can operate on smaller data quantities more
    straightforwardly, let's fallback to the plain NEON implementation of
    XTS for any residual inputs that are not multiples of 128 bytes. This
    allows us to remove a lot of complicated logic that rarely gets
    exercised in practice.
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    dfc6031e
aes-neonbs-core.S 21.6 KB