From 004a403c2e954734090a69aedc7f4f822bdcc142 Mon Sep 17 00:00:00 2001
From: Loc Ho <lho@amcc.com>
Date: Wed, 14 May 2008 20:41:47 +0800
Subject: [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>
---
 crypto/api.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'crypto/api.c')

diff --git a/crypto/api.c b/crypto/api.c
index 0a0f41ef255..d06e33270ab 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);
 	
-- 
cgit v1.2.3-70-g09d2