• Herbert Xu's avatar
    [CRYPTO] cbc: Require block size to be a power of 2 · 50b6544e
    Herbert Xu authored
    All common block ciphers have a block size that's a power of 2.  In fact,
    all of our block ciphers obey this rule.
    
    If we require this then CBC can be optimised to avoid an expensive divide
    on in-place decryption.
    
    I've also changed the saving of the first IV in the in-place decryption
    case to the last IV because that lets us use walk->iv (which is already
    aligned) for the xor operation where alignment is required.
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    50b6544e
cbc.c 7.45 KB