summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccp/ccp-crypto-main.c
diff options
context:
space:
mode:
authorGary R Hook <gary.hook@amd.com>2017-03-15 19:21:01 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2017-03-24 15:02:55 +0100
commit36cf515b9bbe298e1ce7384620f0d4ec45ad3328 (patch)
tree4772df5332d0e077e6eb51660a064c632ce3ec18 /drivers/crypto/ccp/ccp-crypto-main.c
parentcrypto: ccp - Enable 3DES function on v5 CCPs (diff)
downloadlinux-36cf515b9bbe298e1ce7384620f0d4ec45ad3328.tar.xz
linux-36cf515b9bbe298e1ce7384620f0d4ec45ad3328.zip
crypto: ccp - Enable support for AES GCM on v5 CCPs
A version 5 device provides the primitive commands required for AES GCM. This patch adds support for en/decryption. Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp/ccp-crypto-main.c')
-rw-r--r--drivers/crypto/ccp/ccp-crypto-main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/crypto/ccp/ccp-crypto-main.c b/drivers/crypto/ccp/ccp-crypto-main.c
index 3f1e36d7a8bf..8dccbddabef1 100644
--- a/drivers/crypto/ccp/ccp-crypto-main.c
+++ b/drivers/crypto/ccp/ccp-crypto-main.c
@@ -40,6 +40,7 @@ MODULE_PARM_DESC(des3_disable, "Disable use of 3DES - any non-zero value");
/* List heads for the supported algorithms */
static LIST_HEAD(hash_algs);
static LIST_HEAD(cipher_algs);
+static LIST_HEAD(aead_algs);
/* For any tfm, requests for that tfm must be returned on the order
* received. With multiple queues available, the CCP can process more
@@ -339,6 +340,10 @@ static int ccp_register_algs(void)
ret = ccp_register_aes_xts_algs(&cipher_algs);
if (ret)
return ret;
+
+ ret = ccp_register_aes_aeads(&aead_algs);
+ if (ret)
+ return ret;
}
if (!des3_disable) {
@@ -360,6 +365,7 @@ static void ccp_unregister_algs(void)
{
struct ccp_crypto_ahash_alg *ahash_alg, *ahash_tmp;
struct ccp_crypto_ablkcipher_alg *ablk_alg, *ablk_tmp;
+ struct ccp_crypto_aead *aead_alg, *aead_tmp;
list_for_each_entry_safe(ahash_alg, ahash_tmp, &hash_algs, entry) {
crypto_unregister_ahash(&ahash_alg->alg);
@@ -372,6 +378,12 @@ static void ccp_unregister_algs(void)
list_del(&ablk_alg->entry);
kfree(ablk_alg);
}
+
+ list_for_each_entry_safe(aead_alg, aead_tmp, &aead_algs, entry) {
+ crypto_unregister_aead(&aead_alg->alg);
+ list_del(&aead_alg->entry);
+ kfree(aead_alg);
+ }
}
static int ccp_crypto_init(void)