aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-08-14 08:55:35 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2009-08-14 08:58:18 -0400
commit63b5ac286d5d7f668da537cc53a552578f7674a2 (patch)
tree54fe504dd6df1a856c8c75ad338749cdd3820fc1
parentaef27136b8b5e526f2e96ca1caa30a6d07e70f42 (diff)
crypto: blkcipher - Do not use eseqiv on stream ciphers
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 <herbert@gondor.apana.org.au>
-rw-r--r--crypto/ablkcipher.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 03fb5facf0b4..f6f08336df5d 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -183,6 +183,12 @@ EXPORT_SYMBOL_GPL(crypto_givcipher_type);
183 183
184const char *crypto_default_geniv(const struct crypto_alg *alg) 184const char *crypto_default_geniv(const struct crypto_alg *alg)
185{ 185{
186 if (((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
187 CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize :
188 alg->cra_ablkcipher.ivsize) !=
189 alg->cra_blocksize)
190 return "chainiv";
191
186 return alg->cra_flags & CRYPTO_ALG_ASYNC ? 192 return alg->cra_flags & CRYPTO_ALG_ASYNC ?
187 "eseqiv" : skcipher_default_geniv; 193 "eseqiv" : skcipher_default_geniv;
188} 194}