]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
crypto: ccp - Cleanup hash invocation calls
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 6 Jan 2014 19:34:23 +0000 (13:34 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 15 Jan 2014 03:33:40 +0000 (11:33 +0800)
Cleanup the ahash digest invocations to check the init
return code and make use of the finup routine.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-crypto-aes-cmac.c
drivers/crypto/ccp/ccp-crypto-sha.c

index a52b97a4c843c0ff3283164c19ab2e6abfccf98c..8e162ad820857a4d6ed221c10b327642fd72dfd2 100644 (file)
@@ -198,7 +198,7 @@ static int ccp_aes_cmac_digest(struct ahash_request *req)
        if (ret)
                return ret;
 
-       return ccp_do_cmac_update(req, req->nbytes, 1);
+       return ccp_aes_cmac_finup(req);
 }
 
 static int ccp_aes_cmac_setkey(struct crypto_ahash *tfm, const u8 *key,
index d30f6c893ffbbc8bc14677661558b72d477b44d5..3867290b353149fdcff8a0ddd5b5ab55e90fadee 100644 (file)
@@ -248,9 +248,13 @@ static int ccp_sha_finup(struct ahash_request *req)
 
 static int ccp_sha_digest(struct ahash_request *req)
 {
-       ccp_sha_init(req);
+       int ret;
 
-       return ccp_do_sha_update(req, req->nbytes, 1);
+       ret = ccp_sha_init(req);
+       if (ret)
+               return ret;
+
+       return ccp_sha_finup(req);
 }
 
 static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key,