Skip to content

Commit

Permalink
crypto: ccp - Cleanup hash invocation calls
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tom Lendacky authored and Herbert Xu committed Jan 15, 2014
1 parent 81a59f0 commit 82d1585
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/crypto/ccp/ccp-crypto-aes-cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions drivers/crypto/ccp/ccp-crypto-sha.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 82d1585

Please sign in to comment.