1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016-2021 Intel Corporation
3  */
4 
5 #ifndef _PMD_KASUMI_PRIV_H_
6 #define _PMD_KASUMI_PRIV_H_
7 
8 #include "ipsec_mb_private.h"
9 
10 #define KASUMI_KEY_LENGTH 16
11 #define KASUMI_IV_LENGTH 8
12 #define KASUMI_MAX_BURST 4
13 #define BYTE_LEN 8
14 #define KASUMI_DIGEST_LENGTH 4
15 
16 uint8_t pmd_driver_id_kasumi;
17 
18 static const struct rte_cryptodev_capabilities kasumi_capabilities[] = {
19 	{	/* KASUMI (F9) */
20 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
21 		{.sym = {
22 			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
23 			{.auth = {
24 				.algo = RTE_CRYPTO_AUTH_KASUMI_F9,
25 				.block_size = 8,
26 				.key_size = {
27 					.min = KASUMI_KEY_LENGTH,
28 					.max = KASUMI_KEY_LENGTH,
29 					.increment = 0
30 				},
31 				.digest_size = {
32 					.min = KASUMI_DIGEST_LENGTH,
33 					.max = KASUMI_DIGEST_LENGTH,
34 					.increment = 0
35 				},
36 				.iv_size = { 0 }
37 			}, }
38 		}, }
39 	},
40 	{	/* KASUMI (F8) */
41 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
42 		{.sym = {
43 			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
44 			{.cipher = {
45 				.algo = RTE_CRYPTO_CIPHER_KASUMI_F8,
46 				.block_size = 8,
47 				.key_size = {
48 					.min = KASUMI_KEY_LENGTH,
49 					.max = KASUMI_KEY_LENGTH,
50 					.increment = 0
51 				},
52 				.iv_size = {
53 					.min = KASUMI_IV_LENGTH,
54 					.max = KASUMI_IV_LENGTH,
55 					.increment = 0
56 				}
57 			}, }
58 		}, }
59 	},
60 	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
61 };
62 
63 /** KASUMI private session structure */
64 struct kasumi_session {
65 	/* Keys have to be 16-byte aligned */
66 	kasumi_key_sched_t pKeySched_cipher;
67 	kasumi_key_sched_t pKeySched_hash;
68 	enum ipsec_mb_operation op;
69 	enum rte_crypto_auth_operation auth_op;
70 	uint16_t cipher_iv_offset;
71 } __rte_cache_aligned;
72 
73 struct kasumi_qp_data {
74 	uint8_t temp_digest[KASUMI_DIGEST_LENGTH];
75 	/* *< Buffers used to store the digest generated
76 	 * by the driver when verifying a digest provided
77 	 * by the user (using authentication verify operation)
78 	 */
79 };
80 
81 #endif /* _PMD_KASUMI_PRIV_H_ */
82