• Ard Biesheuvel's avatar
    crypto: ccm - honour alignmask of subordinate MAC cipher · 5338ad70
    Ard Biesheuvel authored
    The CCM driver was recently updated to defer the MAC part of the algorithm
    to a dedicated crypto transform, and a template for instantiating such
    transforms was added at the same time.
    
    However, this new cbcmac template fails to take the alignmask of the
    encapsulated cipher into account, which may result in buffer addresses
    being passed down that are not sufficiently aligned.
    
    So update the code to ensure that the digest buffer in the desc ctx
    appears at a sufficiently aligned offset, and tweak the code so that all
    calls to crypto_cipher_encrypt_one() operate on this buffer exclusively.
    Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    5338ad70
ccm.c 25.5 KB