• Ard Biesheuvel's avatar
    crypto: arm64/aes-ccm - Reuse existing MAC update for AAD input · 948ffc66
    Ard Biesheuvel authored
    CCM combines the counter (CTR) encryption mode with a MAC based on the
    same block cipher. This MAC construction is a bit clunky: it invokes the
    block cipher in a way that cannot be parallelized, resulting in poor CPU
    pipeline efficiency.
    
    The arm64 CCM code mitigates this by interleaving the encryption and MAC
    at the AES round level, resulting in a substantial speedup. But this
    approach does not apply to the additional authenticated data (AAD) which
    is not encrypted.
    
    This means the special asm routine dealing with the AAD is not any
    better than the MAC update routine used by the arm64 AES block
    encryption driver, so let's reuse that, and drop the special AES-CCM
    version.
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    948ffc66
aes-glue.c 29 KB