common/iavf: update copyright date
[dpdk.git] / drivers / crypto / caam_jr / caam_jr_capabilities.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2017-2018 NXP
3  */
4
5 #include <caam_jr_capabilities.h>
6
7 static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = {
8         {       /* MD5 HMAC */
9                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
10                 {.sym = {
11                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
12                         {.auth = {
13                                 .algo = RTE_CRYPTO_AUTH_MD5_HMAC,
14                                 .block_size = 64,
15                                 .key_size = {
16                                         .min = 1,
17                                         .max = 64,
18                                         .increment = 1
19                                 },
20                                 .digest_size = {
21                                         .min = 1,
22                                         .max = 16,
23                                         .increment = 1
24                                 },
25                                 .iv_size = { 0 }
26                         }, }
27                 }, }
28         },
29         {       /* SHA1 HMAC */
30                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
31                 {.sym = {
32                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
33                         {.auth = {
34                                 .algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
35                                 .block_size = 64,
36                                 .key_size = {
37                                         .min = 1,
38                                         .max = 64,
39                                         .increment = 1
40                                 },
41                                 .digest_size = {
42                                         .min = 1,
43                                         .max = 20,
44                                         .increment = 1
45                                 },
46                                 .iv_size = { 0 }
47                         }, }
48                 }, }
49         },
50         {       /* SHA224 HMAC */
51                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
52                 {.sym = {
53                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
54                         {.auth = {
55                                 .algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
56                                 .block_size = 64,
57                                 .key_size = {
58                                         .min = 1,
59                                         .max = 64,
60                                         .increment = 1
61                                 },
62                                 .digest_size = {
63                                         .min = 1,
64                                         .max = 28,
65                                         .increment = 1
66                                 },
67                                 .iv_size = { 0 }
68                         }, }
69                 }, }
70         },
71         {       /* SHA256 HMAC */
72                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
73                 {.sym = {
74                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
75                         {.auth = {
76                                 .algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
77                                 .block_size = 64,
78                                 .key_size = {
79                                         .min = 1,
80                                         .max = 64,
81                                         .increment = 1
82                                 },
83                                 .digest_size = {
84                                         .min = 1,
85                                         .max = 32,
86                                         .increment = 1
87                                 },
88                                 .iv_size = { 0 }
89                         }, }
90                 }, }
91         },
92         {       /* SHA384 HMAC */
93                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
94                 {.sym = {
95                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
96                         {.auth = {
97                                 .algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
98                                 .block_size = 128,
99                                 .key_size = {
100                                         .min = 1,
101                                         .max = 128,
102                                         .increment = 1
103                                 },
104                                 .digest_size = {
105                                         .min = 1,
106                                         .max = 48,
107                                         .increment = 1
108                                 },
109                                 .iv_size = { 0 }
110                         }, }
111                 }, }
112         },
113         {       /* SHA512 HMAC */
114                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
115                 {.sym = {
116                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
117                         {.auth = {
118                                 .algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
119                                 .block_size = 128,
120                                 .key_size = {
121                                         .min = 1,
122                                         .max = 128,
123                                         .increment = 1
124                                 },
125                                 .digest_size = {
126                                         .min = 1,
127                                         .max = 64,
128                                         .increment = 1
129                                 },
130                                 .iv_size = { 0 }
131                         }, }
132                 }, }
133         },
134         {       /* AES GCM */
135                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
136                 {.sym = {
137                         .xform_type = RTE_CRYPTO_SYM_XFORM_AEAD,
138                         {.aead = {
139                                 .algo = RTE_CRYPTO_AEAD_AES_GCM,
140                                 .block_size = 16,
141                                 .key_size = {
142                                         .min = 16,
143                                         .max = 32,
144                                         .increment = 8
145                                 },
146                                 .digest_size = {
147                                         .min = 8,
148                                         .max = 16,
149                                         .increment = 4
150                                 },
151                                 .aad_size = {
152                                         .min = 0,
153                                         .max = 240,
154                                         .increment = 1
155                                 },
156                                 .iv_size = {
157                                         .min = 12,
158                                         .max = 12,
159                                         .increment = 0
160                                 },
161                         }, }
162                 }, }
163         },
164         {       /* AES CBC */
165                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
166                 {.sym = {
167                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
168                         {.cipher = {
169                                 .algo = RTE_CRYPTO_CIPHER_AES_CBC,
170                                 .block_size = 16,
171                                 .key_size = {
172                                         .min = 16,
173                                         .max = 32,
174                                         .increment = 8
175                                 },
176                                 .iv_size = {
177                                         .min = 16,
178                                         .max = 16,
179                                         .increment = 0
180                                 }
181                         }, }
182                 }, }
183         },
184         {       /* AES CTR */
185                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
186                 {.sym = {
187                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
188                         {.cipher = {
189                                 .algo = RTE_CRYPTO_CIPHER_AES_CTR,
190                                 .block_size = 16,
191                                 .key_size = {
192                                         .min = 16,
193                                         .max = 32,
194                                         .increment = 8
195                                 },
196                                 .iv_size = {
197                                         .min = 16,
198                                         .max = 16,
199                                         .increment = 0
200                                 }
201                         }, }
202                 }, }
203         },
204         {       /* 3DES CBC */
205                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
206                 {.sym = {
207                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
208                         {.cipher = {
209                                 .algo = RTE_CRYPTO_CIPHER_3DES_CBC,
210                                 .block_size = 8,
211                                 .key_size = {
212                                         .min = 16,
213                                         .max = 24,
214                                         .increment = 8
215                                 },
216                                 .iv_size = {
217                                         .min = 8,
218                                         .max = 8,
219                                         .increment = 0
220                                 }
221                         }, }
222                 }, }
223         },
224
225         RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
226 };
227
228 static const struct rte_security_capability caam_jr_security_cap[] = {
229         { /* IPsec Lookaside Protocol offload ESP Transport Egress */
230                 .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
231                 .protocol = RTE_SECURITY_PROTOCOL_IPSEC,
232                 .ipsec = {
233                         .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
234                         .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
235                         .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS,
236                         .options = { 0 }
237                 },
238                 .crypto_capabilities = caam_jr_capabilities
239         },
240         { /* IPsec Lookaside Protocol offload ESP Tunnel Ingress */
241                 .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
242                 .protocol = RTE_SECURITY_PROTOCOL_IPSEC,
243                 .ipsec = {
244                         .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
245                         .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
246                         .direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS,
247                         .options = { 0 }
248                 },
249                 .crypto_capabilities = caam_jr_capabilities
250         },
251         {
252                 .action = RTE_SECURITY_ACTION_TYPE_NONE
253         }
254 };
255
256 const struct rte_cryptodev_capabilities *
257 caam_jr_get_cryptodev_capabilities(void)
258 {
259         return caam_jr_capabilities;
260 }
261
262 const struct rte_security_capability *
263 caam_jr_get_security_capabilities(void *device __rte_unused)
264 {
265         return caam_jr_security_cap;
266 }