Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 50b6544e authored by Herbert Xu's avatar Herbert Xu
Browse files

[CRYPTO] cbc: Require block size to be a power of 2


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>
parent 3c7f076d
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment