mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
crypto: ccp - Add SHA-2 384- and 512-bit support
Incorporate 384-bit and 512-bit hashing for a version 5 CCP device Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -146,6 +146,12 @@ static int ccp_do_sha_update(struct ahash_request *req, unsigned int nbytes,
|
||||
case CCP_SHA_TYPE_256:
|
||||
rctx->cmd.u.sha.ctx_len = SHA256_DIGEST_SIZE;
|
||||
break;
|
||||
case CCP_SHA_TYPE_384:
|
||||
rctx->cmd.u.sha.ctx_len = SHA384_DIGEST_SIZE;
|
||||
break;
|
||||
case CCP_SHA_TYPE_512:
|
||||
rctx->cmd.u.sha.ctx_len = SHA512_DIGEST_SIZE;
|
||||
break;
|
||||
default:
|
||||
/* Should never get here */
|
||||
break;
|
||||
@@ -393,6 +399,22 @@ static struct ccp_sha_def sha_algs[] = {
|
||||
.digest_size = SHA256_DIGEST_SIZE,
|
||||
.block_size = SHA256_BLOCK_SIZE,
|
||||
},
|
||||
{
|
||||
.version = CCP_VERSION(5, 0),
|
||||
.name = "sha384",
|
||||
.drv_name = "sha384-ccp",
|
||||
.type = CCP_SHA_TYPE_384,
|
||||
.digest_size = SHA384_DIGEST_SIZE,
|
||||
.block_size = SHA384_BLOCK_SIZE,
|
||||
},
|
||||
{
|
||||
.version = CCP_VERSION(5, 0),
|
||||
.name = "sha512",
|
||||
.drv_name = "sha512-ccp",
|
||||
.type = CCP_SHA_TYPE_512,
|
||||
.digest_size = SHA512_DIGEST_SIZE,
|
||||
.block_size = SHA512_BLOCK_SIZE,
|
||||
},
|
||||
};
|
||||
|
||||
static int ccp_register_hmac_alg(struct list_head *head,
|
||||
|
||||
Reference in New Issue
Block a user