hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/bcm/cipher.h
....@@ -1,17 +1,7 @@
1
+
2
+/* SPDX-License-Identifier: GPL-2.0-only */
13 /*
24 * Copyright 2016 Broadcom
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License, version 2, as
6
- * published by the Free Software Foundation (the "GPL").
7
- *
8
- * This program is distributed in the hope that it will be useful, but
9
- * WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
- * General Public License version 2 (GPLv2) for more details.
12
- *
13
- * You should have received a copy of the GNU General Public License
14
- * version 2 (GPLv2) along with this source code.
155 */
166
177 #ifndef _CIPHER_H
....@@ -22,7 +12,9 @@
2212 #include <linux/mailbox_client.h>
2313 #include <crypto/aes.h>
2414 #include <crypto/internal/hash.h>
15
+#include <crypto/internal/skcipher.h>
2516 #include <crypto/aead.h>
17
+#include <crypto/arc4.h>
2618 #include <crypto/gcm.h>
2719 #include <crypto/sha.h>
2820 #include <crypto/sha3.h>
....@@ -34,9 +26,6 @@
3426 /* Driver supports up to MAX_SPUS SPU blocks */
3527 #define MAX_SPUS 16
3628
37
-#define ARC4_MIN_KEY_SIZE 1
38
-#define ARC4_MAX_KEY_SIZE 256
39
-#define ARC4_BLOCK_SIZE 1
4029 #define ARC4_STATE_SIZE 4
4130
4231 #define CCM_AES_IV_SIZE 16
....@@ -115,7 +104,7 @@
115104 struct iproc_alg_s {
116105 u32 type;
117106 union {
118
- struct crypto_alg crypto;
107
+ struct skcipher_alg skcipher;
119108 struct ahash_alg hash;
120109 struct aead_alg aead;
121110 } alg;
....@@ -162,7 +151,7 @@
162151 u8 rx_stat[ALIGN(SPU_RX_STATUS_LEN, SPU_MSG_ALIGN)];
163152
164153 union {
165
- /* Buffers only used for ablkcipher */
154
+ /* Buffers only used for skcipher */
166155 struct {
167156 /*
168157 * Field used for either SUPDT when RC4 is used
....@@ -227,7 +216,7 @@
227216
228217 /*
229218 * Buffer to hold SPU message header template. Template is created at
230
- * setkey time for ablkcipher requests, since most of the fields in the
219
+ * setkey time for skcipher requests, since most of the fields in the
231220 * header are known at that time. At request time, just fill in a few
232221 * missing pieces related to length of data in the request and IVs, etc.
233222 */
....@@ -269,7 +258,7 @@
269258
270259 /* total todo, rx'd, and sent for this request */
271260 unsigned int total_todo;
272
- unsigned int total_received; /* only valid for ablkcipher */
261
+ unsigned int total_received; /* only valid for skcipher */
273262 unsigned int total_sent;
274263
275264 /*
....@@ -399,7 +388,6 @@
399388 u16 spu_req_hdr_len,
400389 unsigned int is_inbound,
401390 struct spu_cipher_parms *cipher_parms,
402
- bool update_key,
403391 unsigned int data_size);
404392 void (*spu_request_pad)(u8 *pad_start, u32 gcm_padding,
405393 u32 hash_pad_len, enum hash_alg auth_alg,