• Eric Biggers's avatar
    crypto: cbcmac - remove unnecessary alignment logic · 21415bfe
    Eric Biggers authored
    The cbcmac template is aligning a field in its desc context to the
    alignmask of its underlying 'cipher', at runtime.  This is almost
    entirely pointless, since cbcmac is already using the cipher API
    functions that handle alignment themselves, and few ciphers set a
    nonzero alignmask anyway.  Also, even without runtime alignment, an
    alignment of at least 4 bytes can be guaranteed.
    
    Thus, at best this code is optimizing for the rare case of ciphers that
    set an alignmask >= 7, at the cost of hurting the common cases.
    
    Therefore, remove the manual alignment code from cbcmac.
    Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    21415bfe
ccm.c 23.2 KB