| .. | .. |
|---|
| 1 | + |
|---|
| 2 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 3 | /* |
|---|
| 2 | 4 | * 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. |
|---|
| 15 | 5 | */ |
|---|
| 16 | 6 | |
|---|
| 17 | 7 | #ifndef _CIPHER_H |
|---|
| .. | .. |
|---|
| 22 | 12 | #include <linux/mailbox_client.h> |
|---|
| 23 | 13 | #include <crypto/aes.h> |
|---|
| 24 | 14 | #include <crypto/internal/hash.h> |
|---|
| 15 | +#include <crypto/internal/skcipher.h> |
|---|
| 25 | 16 | #include <crypto/aead.h> |
|---|
| 17 | +#include <crypto/arc4.h> |
|---|
| 26 | 18 | #include <crypto/gcm.h> |
|---|
| 27 | 19 | #include <crypto/sha.h> |
|---|
| 28 | 20 | #include <crypto/sha3.h> |
|---|
| .. | .. |
|---|
| 34 | 26 | /* Driver supports up to MAX_SPUS SPU blocks */ |
|---|
| 35 | 27 | #define MAX_SPUS 16 |
|---|
| 36 | 28 | |
|---|
| 37 | | -#define ARC4_MIN_KEY_SIZE 1 |
|---|
| 38 | | -#define ARC4_MAX_KEY_SIZE 256 |
|---|
| 39 | | -#define ARC4_BLOCK_SIZE 1 |
|---|
| 40 | 29 | #define ARC4_STATE_SIZE 4 |
|---|
| 41 | 30 | |
|---|
| 42 | 31 | #define CCM_AES_IV_SIZE 16 |
|---|
| .. | .. |
|---|
| 115 | 104 | struct iproc_alg_s { |
|---|
| 116 | 105 | u32 type; |
|---|
| 117 | 106 | union { |
|---|
| 118 | | - struct crypto_alg crypto; |
|---|
| 107 | + struct skcipher_alg skcipher; |
|---|
| 119 | 108 | struct ahash_alg hash; |
|---|
| 120 | 109 | struct aead_alg aead; |
|---|
| 121 | 110 | } alg; |
|---|
| .. | .. |
|---|
| 162 | 151 | u8 rx_stat[ALIGN(SPU_RX_STATUS_LEN, SPU_MSG_ALIGN)]; |
|---|
| 163 | 152 | |
|---|
| 164 | 153 | union { |
|---|
| 165 | | - /* Buffers only used for ablkcipher */ |
|---|
| 154 | + /* Buffers only used for skcipher */ |
|---|
| 166 | 155 | struct { |
|---|
| 167 | 156 | /* |
|---|
| 168 | 157 | * Field used for either SUPDT when RC4 is used |
|---|
| .. | .. |
|---|
| 227 | 216 | |
|---|
| 228 | 217 | /* |
|---|
| 229 | 218 | * 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 |
|---|
| 231 | 220 | * header are known at that time. At request time, just fill in a few |
|---|
| 232 | 221 | * missing pieces related to length of data in the request and IVs, etc. |
|---|
| 233 | 222 | */ |
|---|
| .. | .. |
|---|
| 269 | 258 | |
|---|
| 270 | 259 | /* total todo, rx'd, and sent for this request */ |
|---|
| 271 | 260 | unsigned int total_todo; |
|---|
| 272 | | - unsigned int total_received; /* only valid for ablkcipher */ |
|---|
| 261 | + unsigned int total_received; /* only valid for skcipher */ |
|---|
| 273 | 262 | unsigned int total_sent; |
|---|
| 274 | 263 | |
|---|
| 275 | 264 | /* |
|---|
| .. | .. |
|---|
| 399 | 388 | u16 spu_req_hdr_len, |
|---|
| 400 | 389 | unsigned int is_inbound, |
|---|
| 401 | 390 | struct spu_cipher_parms *cipher_parms, |
|---|
| 402 | | - bool update_key, |
|---|
| 403 | 391 | unsigned int data_size); |
|---|
| 404 | 392 | void (*spu_request_pad)(u8 *pad_start, u32 gcm_padding, |
|---|
| 405 | 393 | u32 hash_pad_len, enum hash_alg auth_alg, |
|---|