hc
2024-05-10 ee930fffee469d076998274a2ca55e13dc1efb67
kernel/drivers/crypto/omap-aes.h
....@@ -1,18 +1,15 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Cryptographic API.
34 *
45 * Support for OMAP AES HW ACCELERATOR defines
56 *
67 * Copyright (c) 2015 Texas Instruments Incorporated
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 published
10
- * by the Free Software Foundation.
11
- *
128 */
139 #ifndef __OMAP_AES_H__
1410 #define __OMAP_AES_H__
1511
12
+#include <crypto/aes.h>
1613 #include <crypto/engine.h>
1714
1815 #define DST_MAXBURST 4
....@@ -83,7 +80,6 @@
8380
8481 #define FLAGS_INIT BIT(5)
8582 #define FLAGS_FAST BIT(6)
86
-#define FLAGS_BUSY BIT(7)
8783
8884 #define FLAGS_IN_DATA_ST_SHIFT 8
8985 #define FLAGS_OUT_DATA_ST_SHIFT 10
....@@ -102,7 +98,11 @@
10298 u32 key[AES_KEYSIZE_256 / sizeof(u32)];
10399 u8 nonce[4];
104100 struct crypto_skcipher *fallback;
105
- struct crypto_skcipher *ctr;
101
+};
102
+
103
+struct omap_aes_gcm_ctx {
104
+ struct omap_aes_ctx octx;
105
+ struct crypto_aes_ctx actx;
106106 };
107107
108108 struct omap_aes_reqctx {
....@@ -110,13 +110,14 @@
110110 unsigned long mode;
111111 u8 iv[AES_BLOCK_SIZE];
112112 u32 auth_tag[AES_BLOCK_SIZE / sizeof(u32)];
113
+ struct skcipher_request fallback_req; // keep at the end
113114 };
114115
115116 #define OMAP_AES_QUEUE_LENGTH 1
116117 #define OMAP_AES_CACHE_SIZE 0
117118
118119 struct omap_aes_algs_info {
119
- struct crypto_alg *algs_list;
120
+ struct skcipher_alg *algs_list;
120121 unsigned int size;
121122 unsigned int registered;
122123 };
....@@ -166,7 +167,7 @@
166167 struct aead_queue aead_queue;
167168 spinlock_t lock;
168169
169
- struct ablkcipher_request *req;
170
+ struct skcipher_request *req;
170171 struct aead_request *aead_req;
171172 struct crypto_engine *engine;
172173
....@@ -206,8 +207,12 @@
206207 unsigned int keylen);
207208 int omap_aes_gcm_encrypt(struct aead_request *req);
208209 int omap_aes_gcm_decrypt(struct aead_request *req);
210
+int omap_aes_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize);
209211 int omap_aes_4106gcm_encrypt(struct aead_request *req);
210212 int omap_aes_4106gcm_decrypt(struct aead_request *req);
213
+int omap_aes_4106gcm_setauthsize(struct crypto_aead *parent,
214
+ unsigned int authsize);
215
+int omap_aes_gcm_cra_init(struct crypto_aead *tfm);
211216 int omap_aes_write_ctrl(struct omap_aes_dev *dd);
212217 int omap_aes_crypt_dma_start(struct omap_aes_dev *dd);
213218 int omap_aes_crypt_dma_stop(struct omap_aes_dev *dd);