Skip to content

Commit

Permalink
crypto: blkcipher - Do not use eseqiv on stream ciphers
Browse files Browse the repository at this point in the history
Recently we switched to using eseqiv on SMP machines in preference
over chainiv.  However, eseqiv does not support stream ciphers so
they should still default to chainiv.

This patch applies the same check as done by eseqiv to weed out
the stream ciphers.  In particular, all algorithms where the IV
size is not equal to the block size will now default to chainiv.

Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Aug 14, 2009
1 parent aef2713 commit 63b5ac2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/ablkcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ EXPORT_SYMBOL_GPL(crypto_givcipher_type);

const char *crypto_default_geniv(const struct crypto_alg *alg)
{
if (((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize :
alg->cra_ablkcipher.ivsize) !=
alg->cra_blocksize)
return "chainiv";

return alg->cra_flags & CRYPTO_ALG_ASYNC ?
"eseqiv" : skcipher_default_geniv;
}
Expand Down

0 comments on commit 63b5ac2

Please sign in to comment.