summaryrefslogtreecommitdiffstats
path: root/crypto/api.c
diff options
context:
space:
mode:
authorLoc Ho <lho@amcc.com>2008-05-14 20:41:47 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2008-07-10 20:35:13 +0800
commit004a403c2e954734090a69aedc7f4f822bdcc142 (patch)
treee8fadd76113132126e308e01e7cd7cdf6b9d44d6 /crypto/api.c
parent534fe2c1c3ffbbc3db66dba0783c82d3b345fd33 (diff)
downloadlinux-004a403c2e954734090a69aedc7f4f822bdcc142.tar.bz2
[CRYPTO] hash: Add asynchronous hash support
This patch adds asynchronous hash and digest support. Signed-off-by: Loc Ho <lho@amcc.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/api.c')
-rw-r--r--crypto/api.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/api.c b/crypto/api.c
index 0a0f41ef255f..d06e33270abe 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -235,8 +235,12 @@ static int crypto_init_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
return crypto_init_cipher_ops(tfm);
case CRYPTO_ALG_TYPE_DIGEST:
- return crypto_init_digest_ops(tfm);
-
+ if ((mask & CRYPTO_ALG_TYPE_HASH_MASK) !=
+ CRYPTO_ALG_TYPE_HASH_MASK)
+ return crypto_init_digest_ops_async(tfm);
+ else
+ return crypto_init_digest_ops(tfm);
+
case CRYPTO_ALG_TYPE_COMPRESS:
return crypto_init_compress_ops(tfm);