hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/crypto/ccp/ccp-crypto-aes-galois.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * AMD Cryptographic Coprocessor (CCP) AES GCM crypto API support
34 *
45 * Copyright (C) 2016,2017 Advanced Micro Devices, Inc.
56 *
67 * Author: Gary R Hook <gary.hook@amd.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/module.h>
....@@ -45,7 +42,6 @@
4542 ctx->u.aes.type = CCP_AES_TYPE_256;
4643 break;
4744 default:
48
- crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
4945 return -EINVAL;
5046 }
5147
....@@ -175,14 +171,13 @@
175171 .ivsize = GCM_AES_IV_SIZE,
176172 .maxauthsize = AES_BLOCK_SIZE,
177173 .base = {
178
- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
179
- CRYPTO_ALG_ASYNC |
174
+ .cra_flags = CRYPTO_ALG_ASYNC |
175
+ CRYPTO_ALG_ALLOCATES_MEMORY |
180176 CRYPTO_ALG_KERN_DRIVER_ONLY |
181177 CRYPTO_ALG_NEED_FALLBACK,
182178 .cra_blocksize = AES_BLOCK_SIZE,
183179 .cra_ctxsize = sizeof(struct ccp_ctx),
184180 .cra_priority = CCP_CRA_PRIORITY,
185
- .cra_type = &crypto_ablkcipher_type,
186181 .cra_exit = ccp_aes_gcm_cra_exit,
187182 .cra_module = THIS_MODULE,
188183 },
....@@ -232,11 +227,10 @@
232227 snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
233228 def->driver_name);
234229 alg->base.cra_blocksize = def->blocksize;
235
- alg->base.cra_ablkcipher.ivsize = def->ivsize;
236230
237231 ret = crypto_register_aead(alg);
238232 if (ret) {
239
- pr_err("%s ablkcipher algorithm registration error (%d)\n",
233
+ pr_err("%s aead algorithm registration error (%d)\n",
240234 alg->base.cra_name, ret);
241235 kfree(ccp_aead);
242236 return ret;