1ef82c2e8SAnkur Dwivedi /* SPDX-License-Identifier: BSD-3-Clause
2ef82c2e8SAnkur Dwivedi * Copyright(c) 2018 Cavium, Inc
3ef82c2e8SAnkur Dwivedi */
4ef82c2e8SAnkur Dwivedi
5ef82c2e8SAnkur Dwivedi #include <rte_cryptodev.h>
6ef82c2e8SAnkur Dwivedi
7ef82c2e8SAnkur Dwivedi #include "otx_cryptodev_capabilities.h"
8ef82c2e8SAnkur Dwivedi
933bcaae5SKanaka Durga Kotamarthy static const struct rte_cryptodev_capabilities otx_sym_capabilities[] = {
10ef82c2e8SAnkur Dwivedi /* Symmetric capabilities */
11ef82c2e8SAnkur Dwivedi { /* NULL (AUTH) */
12ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
13ef82c2e8SAnkur Dwivedi {.sym = {
14ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
15ef82c2e8SAnkur Dwivedi {.auth = {
16ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_NULL,
17ef82c2e8SAnkur Dwivedi .block_size = 1,
18ef82c2e8SAnkur Dwivedi .key_size = {
19ef82c2e8SAnkur Dwivedi .min = 0,
20ef82c2e8SAnkur Dwivedi .max = 0,
21ef82c2e8SAnkur Dwivedi .increment = 0
22ef82c2e8SAnkur Dwivedi },
23ef82c2e8SAnkur Dwivedi .digest_size = {
24ef82c2e8SAnkur Dwivedi .min = 0,
25ef82c2e8SAnkur Dwivedi .max = 0,
26ef82c2e8SAnkur Dwivedi .increment = 0
27ef82c2e8SAnkur Dwivedi },
28ef82c2e8SAnkur Dwivedi }, },
29ef82c2e8SAnkur Dwivedi }, },
30ef82c2e8SAnkur Dwivedi },
31ef82c2e8SAnkur Dwivedi { /* AES GMAC (AUTH) */
32ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
33ef82c2e8SAnkur Dwivedi {.sym = {
34ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
35ef82c2e8SAnkur Dwivedi {.auth = {
36ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_AES_GMAC,
37ef82c2e8SAnkur Dwivedi .block_size = 16,
38ef82c2e8SAnkur Dwivedi .key_size = {
39ef82c2e8SAnkur Dwivedi .min = 16,
40ef82c2e8SAnkur Dwivedi .max = 32,
41ef82c2e8SAnkur Dwivedi .increment = 8
42ef82c2e8SAnkur Dwivedi },
43ef82c2e8SAnkur Dwivedi .digest_size = {
44ef82c2e8SAnkur Dwivedi .min = 8,
45ef82c2e8SAnkur Dwivedi .max = 16,
46ef82c2e8SAnkur Dwivedi .increment = 4
47ef82c2e8SAnkur Dwivedi },
48ef82c2e8SAnkur Dwivedi .iv_size = {
49ef82c2e8SAnkur Dwivedi .min = 12,
50ef82c2e8SAnkur Dwivedi .max = 12,
51ef82c2e8SAnkur Dwivedi .increment = 0
52ef82c2e8SAnkur Dwivedi }
53ef82c2e8SAnkur Dwivedi }, }
54ef82c2e8SAnkur Dwivedi }, }
55ef82c2e8SAnkur Dwivedi },
56ef82c2e8SAnkur Dwivedi { /* KASUMI (F9) */
57ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
58ef82c2e8SAnkur Dwivedi {.sym = {
59ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
60ef82c2e8SAnkur Dwivedi {.auth = {
61ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_KASUMI_F9,
62ef82c2e8SAnkur Dwivedi .block_size = 8,
63ef82c2e8SAnkur Dwivedi .key_size = {
64ef82c2e8SAnkur Dwivedi .min = 16,
65ef82c2e8SAnkur Dwivedi .max = 16,
66ef82c2e8SAnkur Dwivedi .increment = 0
67ef82c2e8SAnkur Dwivedi },
68ef82c2e8SAnkur Dwivedi .digest_size = {
69ef82c2e8SAnkur Dwivedi .min = 4,
70ef82c2e8SAnkur Dwivedi .max = 4,
71ef82c2e8SAnkur Dwivedi .increment = 0
72ef82c2e8SAnkur Dwivedi },
73ef82c2e8SAnkur Dwivedi }, }
74ef82c2e8SAnkur Dwivedi }, }
75ef82c2e8SAnkur Dwivedi },
76ef82c2e8SAnkur Dwivedi { /* MD5 */
77ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
78ef82c2e8SAnkur Dwivedi {.sym = {
79ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
80ef82c2e8SAnkur Dwivedi {.auth = {
81ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_MD5,
82ef82c2e8SAnkur Dwivedi .block_size = 64,
83ef82c2e8SAnkur Dwivedi .key_size = {
84ef82c2e8SAnkur Dwivedi .min = 0,
85ef82c2e8SAnkur Dwivedi .max = 0,
86ef82c2e8SAnkur Dwivedi .increment = 0
87ef82c2e8SAnkur Dwivedi },
88ef82c2e8SAnkur Dwivedi .digest_size = {
89*8d8afdecSTejasree Kondoj .min = 1,
90ef82c2e8SAnkur Dwivedi .max = 16,
91*8d8afdecSTejasree Kondoj .increment = 1
92ef82c2e8SAnkur Dwivedi },
93ef82c2e8SAnkur Dwivedi }, }
94ef82c2e8SAnkur Dwivedi }, }
95ef82c2e8SAnkur Dwivedi },
96ef82c2e8SAnkur Dwivedi { /* MD5 HMAC */
97ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
98ef82c2e8SAnkur Dwivedi {.sym = {
99ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
100ef82c2e8SAnkur Dwivedi {.auth = {
101ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_MD5_HMAC,
102ef82c2e8SAnkur Dwivedi .block_size = 64,
103ef82c2e8SAnkur Dwivedi .key_size = {
104ef82c2e8SAnkur Dwivedi .min = 8,
105ef82c2e8SAnkur Dwivedi .max = 64,
106ef82c2e8SAnkur Dwivedi .increment = 8
107ef82c2e8SAnkur Dwivedi },
108ef82c2e8SAnkur Dwivedi .digest_size = {
109*8d8afdecSTejasree Kondoj .min = 1,
110ef82c2e8SAnkur Dwivedi .max = 16,
111*8d8afdecSTejasree Kondoj .increment = 1
112ef82c2e8SAnkur Dwivedi },
113ef82c2e8SAnkur Dwivedi }, }
114ef82c2e8SAnkur Dwivedi }, }
115ef82c2e8SAnkur Dwivedi },
116ef82c2e8SAnkur Dwivedi { /* SHA1 */
117ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
118ef82c2e8SAnkur Dwivedi {.sym = {
119ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
120ef82c2e8SAnkur Dwivedi {.auth = {
121ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA1,
122ef82c2e8SAnkur Dwivedi .block_size = 64,
123ef82c2e8SAnkur Dwivedi .key_size = {
124ef82c2e8SAnkur Dwivedi .min = 0,
125ef82c2e8SAnkur Dwivedi .max = 0,
126ef82c2e8SAnkur Dwivedi .increment = 0
127ef82c2e8SAnkur Dwivedi },
128ef82c2e8SAnkur Dwivedi .digest_size = {
129*8d8afdecSTejasree Kondoj .min = 1,
130ef82c2e8SAnkur Dwivedi .max = 20,
131*8d8afdecSTejasree Kondoj .increment = 1
132ef82c2e8SAnkur Dwivedi },
133ef82c2e8SAnkur Dwivedi }, }
134ef82c2e8SAnkur Dwivedi }, }
135ef82c2e8SAnkur Dwivedi },
136ef82c2e8SAnkur Dwivedi { /* SHA1 HMAC */
137ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
138ef82c2e8SAnkur Dwivedi {.sym = {
139ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
140ef82c2e8SAnkur Dwivedi {.auth = {
141ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
142ef82c2e8SAnkur Dwivedi .block_size = 64,
143ef82c2e8SAnkur Dwivedi .key_size = {
1442839a8abSSucharitha Sarananaga .min = 1,
1452839a8abSSucharitha Sarananaga .max = 1024,
1462839a8abSSucharitha Sarananaga .increment = 1
147ef82c2e8SAnkur Dwivedi },
148ef82c2e8SAnkur Dwivedi .digest_size = {
149*8d8afdecSTejasree Kondoj .min = 1,
150ef82c2e8SAnkur Dwivedi .max = 20,
151*8d8afdecSTejasree Kondoj .increment = 1
152ef82c2e8SAnkur Dwivedi },
153ef82c2e8SAnkur Dwivedi }, }
154ef82c2e8SAnkur Dwivedi }, }
155ef82c2e8SAnkur Dwivedi },
156ef82c2e8SAnkur Dwivedi { /* SHA224 */
157ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
158ef82c2e8SAnkur Dwivedi {.sym = {
159ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
160ef82c2e8SAnkur Dwivedi {.auth = {
161ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA224,
162ef82c2e8SAnkur Dwivedi .block_size = 64,
163ef82c2e8SAnkur Dwivedi .key_size = {
164ef82c2e8SAnkur Dwivedi .min = 0,
165ef82c2e8SAnkur Dwivedi .max = 0,
166ef82c2e8SAnkur Dwivedi .increment = 0
167ef82c2e8SAnkur Dwivedi },
168ef82c2e8SAnkur Dwivedi .digest_size = {
169*8d8afdecSTejasree Kondoj .min = 1,
170ef82c2e8SAnkur Dwivedi .max = 28,
171*8d8afdecSTejasree Kondoj .increment = 1
172ef82c2e8SAnkur Dwivedi },
173ef82c2e8SAnkur Dwivedi }, }
174ef82c2e8SAnkur Dwivedi }, }
175ef82c2e8SAnkur Dwivedi },
176ef82c2e8SAnkur Dwivedi { /* SHA224 HMAC */
177ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
178ef82c2e8SAnkur Dwivedi {.sym = {
179ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
180ef82c2e8SAnkur Dwivedi {.auth = {
181ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
182ef82c2e8SAnkur Dwivedi .block_size = 64,
183ef82c2e8SAnkur Dwivedi .key_size = {
1842839a8abSSucharitha Sarananaga .min = 1,
1852839a8abSSucharitha Sarananaga .max = 1024,
1862839a8abSSucharitha Sarananaga .increment = 1
187ef82c2e8SAnkur Dwivedi },
188ef82c2e8SAnkur Dwivedi .digest_size = {
189*8d8afdecSTejasree Kondoj .min = 1,
190ef82c2e8SAnkur Dwivedi .max = 28,
191*8d8afdecSTejasree Kondoj .increment = 1
192ef82c2e8SAnkur Dwivedi },
193ef82c2e8SAnkur Dwivedi }, }
194ef82c2e8SAnkur Dwivedi }, }
195ef82c2e8SAnkur Dwivedi },
196ef82c2e8SAnkur Dwivedi { /* SHA256 */
197ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
198ef82c2e8SAnkur Dwivedi {.sym = {
199ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
200ef82c2e8SAnkur Dwivedi {.auth = {
201ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA256,
202ef82c2e8SAnkur Dwivedi .block_size = 64,
203ef82c2e8SAnkur Dwivedi .key_size = {
204ef82c2e8SAnkur Dwivedi .min = 0,
205ef82c2e8SAnkur Dwivedi .max = 0,
206ef82c2e8SAnkur Dwivedi .increment = 0
207ef82c2e8SAnkur Dwivedi },
208ef82c2e8SAnkur Dwivedi .digest_size = {
209*8d8afdecSTejasree Kondoj .min = 1,
210ef82c2e8SAnkur Dwivedi .max = 32,
211*8d8afdecSTejasree Kondoj .increment = 1
212ef82c2e8SAnkur Dwivedi },
213ef82c2e8SAnkur Dwivedi }, }
214ef82c2e8SAnkur Dwivedi }, }
215ef82c2e8SAnkur Dwivedi },
216ef82c2e8SAnkur Dwivedi { /* SHA256 HMAC */
217ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
218ef82c2e8SAnkur Dwivedi {.sym = {
219ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
220ef82c2e8SAnkur Dwivedi {.auth = {
221ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
222ef82c2e8SAnkur Dwivedi .block_size = 64,
223ef82c2e8SAnkur Dwivedi .key_size = {
2242839a8abSSucharitha Sarananaga .min = 1,
2252839a8abSSucharitha Sarananaga .max = 1024,
2262839a8abSSucharitha Sarananaga .increment = 1
227ef82c2e8SAnkur Dwivedi },
228ef82c2e8SAnkur Dwivedi .digest_size = {
229*8d8afdecSTejasree Kondoj .min = 1,
230ef82c2e8SAnkur Dwivedi .max = 32,
231*8d8afdecSTejasree Kondoj .increment = 1
232ef82c2e8SAnkur Dwivedi },
233ef82c2e8SAnkur Dwivedi }, }
234ef82c2e8SAnkur Dwivedi }, }
235ef82c2e8SAnkur Dwivedi },
236ef82c2e8SAnkur Dwivedi { /* SHA384 */
237ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
238ef82c2e8SAnkur Dwivedi {.sym = {
239ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
240ef82c2e8SAnkur Dwivedi {.auth = {
241ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA384,
242ef82c2e8SAnkur Dwivedi .block_size = 64,
243ef82c2e8SAnkur Dwivedi .key_size = {
244ef82c2e8SAnkur Dwivedi .min = 0,
245ef82c2e8SAnkur Dwivedi .max = 0,
246ef82c2e8SAnkur Dwivedi .increment = 0
247ef82c2e8SAnkur Dwivedi },
248ef82c2e8SAnkur Dwivedi .digest_size = {
249*8d8afdecSTejasree Kondoj .min = 1,
250ef82c2e8SAnkur Dwivedi .max = 48,
251*8d8afdecSTejasree Kondoj .increment = 1
252ef82c2e8SAnkur Dwivedi },
253ef82c2e8SAnkur Dwivedi }, }
254ef82c2e8SAnkur Dwivedi }, }
255ef82c2e8SAnkur Dwivedi },
256ef82c2e8SAnkur Dwivedi { /* SHA384 HMAC */
257ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
258ef82c2e8SAnkur Dwivedi {.sym = {
259ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
260ef82c2e8SAnkur Dwivedi {.auth = {
261ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
262ef82c2e8SAnkur Dwivedi .block_size = 64,
263ef82c2e8SAnkur Dwivedi .key_size = {
2642839a8abSSucharitha Sarananaga .min = 1,
2652839a8abSSucharitha Sarananaga .max = 1024,
2662839a8abSSucharitha Sarananaga .increment = 1
267ef82c2e8SAnkur Dwivedi },
268ef82c2e8SAnkur Dwivedi .digest_size = {
269*8d8afdecSTejasree Kondoj .min = 1,
270ef82c2e8SAnkur Dwivedi .max = 48,
271*8d8afdecSTejasree Kondoj .increment = 1
272ef82c2e8SAnkur Dwivedi },
273ef82c2e8SAnkur Dwivedi }, }
274ef82c2e8SAnkur Dwivedi }, }
275ef82c2e8SAnkur Dwivedi },
276ef82c2e8SAnkur Dwivedi { /* SHA512 */
277ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
278ef82c2e8SAnkur Dwivedi {.sym = {
279ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
280ef82c2e8SAnkur Dwivedi {.auth = {
281ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA512,
282ef82c2e8SAnkur Dwivedi .block_size = 128,
283ef82c2e8SAnkur Dwivedi .key_size = {
284ef82c2e8SAnkur Dwivedi .min = 0,
285ef82c2e8SAnkur Dwivedi .max = 0,
286ef82c2e8SAnkur Dwivedi .increment = 0
287ef82c2e8SAnkur Dwivedi },
288ef82c2e8SAnkur Dwivedi .digest_size = {
289*8d8afdecSTejasree Kondoj .min = 1,
290ef82c2e8SAnkur Dwivedi .max = 64,
291*8d8afdecSTejasree Kondoj .increment = 1
292ef82c2e8SAnkur Dwivedi },
293ef82c2e8SAnkur Dwivedi }, }
294ef82c2e8SAnkur Dwivedi }, }
295ef82c2e8SAnkur Dwivedi },
296ef82c2e8SAnkur Dwivedi { /* SHA512 HMAC */
297ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
298ef82c2e8SAnkur Dwivedi {.sym = {
299ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
300ef82c2e8SAnkur Dwivedi {.auth = {
301ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
302ef82c2e8SAnkur Dwivedi .block_size = 128,
303ef82c2e8SAnkur Dwivedi .key_size = {
3042839a8abSSucharitha Sarananaga .min = 1,
3052839a8abSSucharitha Sarananaga .max = 1024,
3062839a8abSSucharitha Sarananaga .increment = 1
307ef82c2e8SAnkur Dwivedi },
308ef82c2e8SAnkur Dwivedi .digest_size = {
309*8d8afdecSTejasree Kondoj .min = 1,
310ef82c2e8SAnkur Dwivedi .max = 64,
311*8d8afdecSTejasree Kondoj .increment = 1
312ef82c2e8SAnkur Dwivedi },
313ef82c2e8SAnkur Dwivedi }, }
314ef82c2e8SAnkur Dwivedi }, }
315ef82c2e8SAnkur Dwivedi },
316ef82c2e8SAnkur Dwivedi { /* SNOW 3G (UIA2) */
317ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
318ef82c2e8SAnkur Dwivedi {.sym = {
319ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
320ef82c2e8SAnkur Dwivedi {.auth = {
321ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2,
322ef82c2e8SAnkur Dwivedi .block_size = 16,
323ef82c2e8SAnkur Dwivedi .key_size = {
324ef82c2e8SAnkur Dwivedi .min = 16,
325ef82c2e8SAnkur Dwivedi .max = 16,
326ef82c2e8SAnkur Dwivedi .increment = 0
327ef82c2e8SAnkur Dwivedi },
328ef82c2e8SAnkur Dwivedi .digest_size = {
329ef82c2e8SAnkur Dwivedi .min = 4,
330ef82c2e8SAnkur Dwivedi .max = 4,
331ef82c2e8SAnkur Dwivedi .increment = 0
332ef82c2e8SAnkur Dwivedi },
333ef82c2e8SAnkur Dwivedi .iv_size = {
334ef82c2e8SAnkur Dwivedi .min = 16,
335ef82c2e8SAnkur Dwivedi .max = 16,
336ef82c2e8SAnkur Dwivedi .increment = 0
337ef82c2e8SAnkur Dwivedi }
338ef82c2e8SAnkur Dwivedi }, }
339ef82c2e8SAnkur Dwivedi }, }
340ef82c2e8SAnkur Dwivedi },
341ef82c2e8SAnkur Dwivedi { /* ZUC (EIA3) */
342ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
343ef82c2e8SAnkur Dwivedi {.sym = {
344ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
345ef82c2e8SAnkur Dwivedi {.auth = {
346ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AUTH_ZUC_EIA3,
347ef82c2e8SAnkur Dwivedi .block_size = 16,
348ef82c2e8SAnkur Dwivedi .key_size = {
349ef82c2e8SAnkur Dwivedi .min = 16,
350ef82c2e8SAnkur Dwivedi .max = 16,
351ef82c2e8SAnkur Dwivedi .increment = 0
352ef82c2e8SAnkur Dwivedi },
353ef82c2e8SAnkur Dwivedi .digest_size = {
354ef82c2e8SAnkur Dwivedi .min = 4,
355ef82c2e8SAnkur Dwivedi .max = 4,
356ef82c2e8SAnkur Dwivedi .increment = 0
357ef82c2e8SAnkur Dwivedi },
358ef82c2e8SAnkur Dwivedi .iv_size = {
359ef82c2e8SAnkur Dwivedi .min = 16,
360ef82c2e8SAnkur Dwivedi .max = 16,
361ef82c2e8SAnkur Dwivedi .increment = 0
362ef82c2e8SAnkur Dwivedi }
363ef82c2e8SAnkur Dwivedi }, }
364ef82c2e8SAnkur Dwivedi }, }
365ef82c2e8SAnkur Dwivedi },
366ef82c2e8SAnkur Dwivedi { /* NULL (CIPHER) */
367ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
368ef82c2e8SAnkur Dwivedi {.sym = {
369ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
370ef82c2e8SAnkur Dwivedi {.cipher = {
371ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_NULL,
372ef82c2e8SAnkur Dwivedi .block_size = 1,
373ef82c2e8SAnkur Dwivedi .key_size = {
374ef82c2e8SAnkur Dwivedi .min = 0,
375ef82c2e8SAnkur Dwivedi .max = 0,
376ef82c2e8SAnkur Dwivedi .increment = 0
377ef82c2e8SAnkur Dwivedi },
378ef82c2e8SAnkur Dwivedi .iv_size = {
379ef82c2e8SAnkur Dwivedi .min = 0,
380ef82c2e8SAnkur Dwivedi .max = 0,
381ef82c2e8SAnkur Dwivedi .increment = 0
382ef82c2e8SAnkur Dwivedi }
383ef82c2e8SAnkur Dwivedi }, },
384ef82c2e8SAnkur Dwivedi }, }
385ef82c2e8SAnkur Dwivedi },
386ef82c2e8SAnkur Dwivedi { /* 3DES CBC */
387ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
388ef82c2e8SAnkur Dwivedi {.sym = {
389ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
390ef82c2e8SAnkur Dwivedi {.cipher = {
391ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_3DES_CBC,
392ef82c2e8SAnkur Dwivedi .block_size = 8,
393ef82c2e8SAnkur Dwivedi .key_size = {
394ef82c2e8SAnkur Dwivedi .min = 24,
395ef82c2e8SAnkur Dwivedi .max = 24,
396ef82c2e8SAnkur Dwivedi .increment = 0
397ef82c2e8SAnkur Dwivedi },
398ef82c2e8SAnkur Dwivedi .iv_size = {
399ef82c2e8SAnkur Dwivedi .min = 8,
400ef82c2e8SAnkur Dwivedi .max = 16,
401ef82c2e8SAnkur Dwivedi .increment = 8
402ef82c2e8SAnkur Dwivedi }
403ef82c2e8SAnkur Dwivedi }, }
404ef82c2e8SAnkur Dwivedi }, }
405ef82c2e8SAnkur Dwivedi },
406ef82c2e8SAnkur Dwivedi { /* 3DES ECB */
407ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
408ef82c2e8SAnkur Dwivedi {.sym = {
409ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
410ef82c2e8SAnkur Dwivedi {.cipher = {
411ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_3DES_ECB,
412ef82c2e8SAnkur Dwivedi .block_size = 8,
413ef82c2e8SAnkur Dwivedi .key_size = {
414ef82c2e8SAnkur Dwivedi .min = 24,
415ef82c2e8SAnkur Dwivedi .max = 24,
416ef82c2e8SAnkur Dwivedi .increment = 0
417ef82c2e8SAnkur Dwivedi },
418ef82c2e8SAnkur Dwivedi .iv_size = {
419ef82c2e8SAnkur Dwivedi .min = 0,
420ef82c2e8SAnkur Dwivedi .max = 0,
421ef82c2e8SAnkur Dwivedi .increment = 0
422ef82c2e8SAnkur Dwivedi }
423ef82c2e8SAnkur Dwivedi }, }
424ef82c2e8SAnkur Dwivedi }, }
425ef82c2e8SAnkur Dwivedi },
426ef82c2e8SAnkur Dwivedi { /* AES CBC */
427ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
428ef82c2e8SAnkur Dwivedi {.sym = {
429ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
430ef82c2e8SAnkur Dwivedi {.cipher = {
431ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_AES_CBC,
432ef82c2e8SAnkur Dwivedi .block_size = 16,
433ef82c2e8SAnkur Dwivedi .key_size = {
434ef82c2e8SAnkur Dwivedi .min = 16,
435ef82c2e8SAnkur Dwivedi .max = 32,
436ef82c2e8SAnkur Dwivedi .increment = 8
437ef82c2e8SAnkur Dwivedi },
438ef82c2e8SAnkur Dwivedi .iv_size = {
439ef82c2e8SAnkur Dwivedi .min = 16,
440ef82c2e8SAnkur Dwivedi .max = 16,
441ef82c2e8SAnkur Dwivedi .increment = 0
442ef82c2e8SAnkur Dwivedi }
443ef82c2e8SAnkur Dwivedi }, }
444ef82c2e8SAnkur Dwivedi }, }
445ef82c2e8SAnkur Dwivedi },
446ef82c2e8SAnkur Dwivedi { /* AES CTR */
447ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
448ef82c2e8SAnkur Dwivedi {.sym = {
449ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
450ef82c2e8SAnkur Dwivedi {.cipher = {
451ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_AES_CTR,
452ef82c2e8SAnkur Dwivedi .block_size = 16,
453ef82c2e8SAnkur Dwivedi .key_size = {
454ef82c2e8SAnkur Dwivedi .min = 16,
455ef82c2e8SAnkur Dwivedi .max = 32,
456ef82c2e8SAnkur Dwivedi .increment = 8
457ef82c2e8SAnkur Dwivedi },
458ef82c2e8SAnkur Dwivedi .iv_size = {
459ef82c2e8SAnkur Dwivedi .min = 12,
460ef82c2e8SAnkur Dwivedi .max = 16,
461ef82c2e8SAnkur Dwivedi .increment = 4
462ef82c2e8SAnkur Dwivedi }
463ef82c2e8SAnkur Dwivedi }, }
464ef82c2e8SAnkur Dwivedi }, }
465ef82c2e8SAnkur Dwivedi },
466ef82c2e8SAnkur Dwivedi { /* AES XTS */
467ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
468ef82c2e8SAnkur Dwivedi {.sym = {
469ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
470ef82c2e8SAnkur Dwivedi {.cipher = {
471ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_AES_XTS,
472ef82c2e8SAnkur Dwivedi .block_size = 16,
473ef82c2e8SAnkur Dwivedi .key_size = {
474ef82c2e8SAnkur Dwivedi .min = 32,
475ef82c2e8SAnkur Dwivedi .max = 64,
476ef82c2e8SAnkur Dwivedi .increment = 0
477ef82c2e8SAnkur Dwivedi },
478ef82c2e8SAnkur Dwivedi .iv_size = {
479ef82c2e8SAnkur Dwivedi .min = 16,
480ef82c2e8SAnkur Dwivedi .max = 16,
481ef82c2e8SAnkur Dwivedi .increment = 0
482ef82c2e8SAnkur Dwivedi }
483ef82c2e8SAnkur Dwivedi }, }
484ef82c2e8SAnkur Dwivedi }, }
485ef82c2e8SAnkur Dwivedi },
486ef82c2e8SAnkur Dwivedi { /* DES CBC */
487ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
488ef82c2e8SAnkur Dwivedi {.sym = {
489ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
490ef82c2e8SAnkur Dwivedi {.cipher = {
491ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_DES_CBC,
492ef82c2e8SAnkur Dwivedi .block_size = 8,
493ef82c2e8SAnkur Dwivedi .key_size = {
494ef82c2e8SAnkur Dwivedi .min = 8,
495ef82c2e8SAnkur Dwivedi .max = 8,
496ef82c2e8SAnkur Dwivedi .increment = 0
497ef82c2e8SAnkur Dwivedi },
498ef82c2e8SAnkur Dwivedi .iv_size = {
499ef82c2e8SAnkur Dwivedi .min = 8,
500ef82c2e8SAnkur Dwivedi .max = 8,
501ef82c2e8SAnkur Dwivedi .increment = 0
502ef82c2e8SAnkur Dwivedi }
503ef82c2e8SAnkur Dwivedi }, }
504ef82c2e8SAnkur Dwivedi }, }
505ef82c2e8SAnkur Dwivedi },
506ef82c2e8SAnkur Dwivedi { /* KASUMI (F8) */
507ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
508ef82c2e8SAnkur Dwivedi {.sym = {
509ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
510ef82c2e8SAnkur Dwivedi {.cipher = {
511ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_KASUMI_F8,
512ef82c2e8SAnkur Dwivedi .block_size = 8,
513ef82c2e8SAnkur Dwivedi .key_size = {
514ef82c2e8SAnkur Dwivedi .min = 16,
515ef82c2e8SAnkur Dwivedi .max = 16,
516ef82c2e8SAnkur Dwivedi .increment = 0
517ef82c2e8SAnkur Dwivedi },
518ef82c2e8SAnkur Dwivedi .iv_size = {
519ef82c2e8SAnkur Dwivedi .min = 8,
520ef82c2e8SAnkur Dwivedi .max = 8,
521ef82c2e8SAnkur Dwivedi .increment = 0
522ef82c2e8SAnkur Dwivedi }
523ef82c2e8SAnkur Dwivedi }, }
524ef82c2e8SAnkur Dwivedi }, }
525ef82c2e8SAnkur Dwivedi },
526ef82c2e8SAnkur Dwivedi { /* SNOW 3G (UEA2) */
527ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
528ef82c2e8SAnkur Dwivedi {.sym = {
529ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
530ef82c2e8SAnkur Dwivedi {.cipher = {
531ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2,
532ef82c2e8SAnkur Dwivedi .block_size = 16,
533ef82c2e8SAnkur Dwivedi .key_size = {
534ef82c2e8SAnkur Dwivedi .min = 16,
535ef82c2e8SAnkur Dwivedi .max = 16,
536ef82c2e8SAnkur Dwivedi .increment = 0
537ef82c2e8SAnkur Dwivedi },
538ef82c2e8SAnkur Dwivedi .iv_size = {
539ef82c2e8SAnkur Dwivedi .min = 16,
540ef82c2e8SAnkur Dwivedi .max = 16,
541ef82c2e8SAnkur Dwivedi .increment = 0
542ef82c2e8SAnkur Dwivedi }
543ef82c2e8SAnkur Dwivedi }, }
544ef82c2e8SAnkur Dwivedi }, }
545ef82c2e8SAnkur Dwivedi },
546ef82c2e8SAnkur Dwivedi { /* ZUC (EEA3) */
547ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
548ef82c2e8SAnkur Dwivedi {.sym = {
549ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
550ef82c2e8SAnkur Dwivedi {.cipher = {
551ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_CIPHER_ZUC_EEA3,
552ef82c2e8SAnkur Dwivedi .block_size = 16,
553ef82c2e8SAnkur Dwivedi .key_size = {
554ef82c2e8SAnkur Dwivedi .min = 16,
555ef82c2e8SAnkur Dwivedi .max = 16,
556ef82c2e8SAnkur Dwivedi .increment = 0
557ef82c2e8SAnkur Dwivedi },
558ef82c2e8SAnkur Dwivedi .iv_size = {
559ef82c2e8SAnkur Dwivedi .min = 16,
560ef82c2e8SAnkur Dwivedi .max = 16,
561ef82c2e8SAnkur Dwivedi .increment = 0
562ef82c2e8SAnkur Dwivedi }
563ef82c2e8SAnkur Dwivedi }, }
564ef82c2e8SAnkur Dwivedi }, }
565ef82c2e8SAnkur Dwivedi },
566ef82c2e8SAnkur Dwivedi { /* AES GCM */
567ef82c2e8SAnkur Dwivedi .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
568ef82c2e8SAnkur Dwivedi {.sym = {
569ef82c2e8SAnkur Dwivedi .xform_type = RTE_CRYPTO_SYM_XFORM_AEAD,
570ef82c2e8SAnkur Dwivedi {.aead = {
571ef82c2e8SAnkur Dwivedi .algo = RTE_CRYPTO_AEAD_AES_GCM,
572ef82c2e8SAnkur Dwivedi .block_size = 16,
573ef82c2e8SAnkur Dwivedi .key_size = {
574ef82c2e8SAnkur Dwivedi .min = 16,
575ef82c2e8SAnkur Dwivedi .max = 32,
576ef82c2e8SAnkur Dwivedi .increment = 8
577ef82c2e8SAnkur Dwivedi },
578ef82c2e8SAnkur Dwivedi .digest_size = {
579ef82c2e8SAnkur Dwivedi .min = 8,
580ef82c2e8SAnkur Dwivedi .max = 16,
581ef82c2e8SAnkur Dwivedi .increment = 4
582ef82c2e8SAnkur Dwivedi },
583ef82c2e8SAnkur Dwivedi .aad_size = {
584ef82c2e8SAnkur Dwivedi .min = 0,
585ef82c2e8SAnkur Dwivedi .max = 1024,
586ef82c2e8SAnkur Dwivedi .increment = 1
587ef82c2e8SAnkur Dwivedi },
588ef82c2e8SAnkur Dwivedi .iv_size = {
589ef82c2e8SAnkur Dwivedi .min = 12,
590ef82c2e8SAnkur Dwivedi .max = 12,
591ef82c2e8SAnkur Dwivedi .increment = 0
592ef82c2e8SAnkur Dwivedi }
593ef82c2e8SAnkur Dwivedi }, }
594ef82c2e8SAnkur Dwivedi }, }
595ef82c2e8SAnkur Dwivedi },
596ef82c2e8SAnkur Dwivedi /* End of symmetric capabilities */
597ef82c2e8SAnkur Dwivedi RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
598ef82c2e8SAnkur Dwivedi };
599ef82c2e8SAnkur Dwivedi
60033bcaae5SKanaka Durga Kotamarthy static const struct rte_cryptodev_capabilities otx_asym_capabilities[] = {
60133bcaae5SKanaka Durga Kotamarthy /* Asymmetric capabilities */
60233bcaae5SKanaka Durga Kotamarthy { /* RSA */
60333bcaae5SKanaka Durga Kotamarthy .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
60433bcaae5SKanaka Durga Kotamarthy {.asym = {
60533bcaae5SKanaka Durga Kotamarthy .xform_capa = {
60633bcaae5SKanaka Durga Kotamarthy .xform_type = RTE_CRYPTO_ASYM_XFORM_RSA,
60733bcaae5SKanaka Durga Kotamarthy .op_types = ((1 << RTE_CRYPTO_ASYM_OP_SIGN) |
60833bcaae5SKanaka Durga Kotamarthy (1 << RTE_CRYPTO_ASYM_OP_VERIFY) |
60933bcaae5SKanaka Durga Kotamarthy (1 << RTE_CRYPTO_ASYM_OP_ENCRYPT) |
61033bcaae5SKanaka Durga Kotamarthy (1 << RTE_CRYPTO_ASYM_OP_DECRYPT)),
61133bcaae5SKanaka Durga Kotamarthy {.modlen = {
61233bcaae5SKanaka Durga Kotamarthy .min = 17,
61333bcaae5SKanaka Durga Kotamarthy .max = 1024,
61433bcaae5SKanaka Durga Kotamarthy .increment = 1
61533bcaae5SKanaka Durga Kotamarthy }, }
61633bcaae5SKanaka Durga Kotamarthy }
61733bcaae5SKanaka Durga Kotamarthy }, }
61833bcaae5SKanaka Durga Kotamarthy },
61933bcaae5SKanaka Durga Kotamarthy { /* MOD_EXP */
62033bcaae5SKanaka Durga Kotamarthy .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
62133bcaae5SKanaka Durga Kotamarthy {.asym = {
62233bcaae5SKanaka Durga Kotamarthy .xform_capa = {
62333bcaae5SKanaka Durga Kotamarthy .xform_type = RTE_CRYPTO_ASYM_XFORM_MODEX,
62433bcaae5SKanaka Durga Kotamarthy .op_types = 0,
62533bcaae5SKanaka Durga Kotamarthy {.modlen = {
62633bcaae5SKanaka Durga Kotamarthy .min = 17,
62733bcaae5SKanaka Durga Kotamarthy .max = 1024,
62833bcaae5SKanaka Durga Kotamarthy .increment = 1
62933bcaae5SKanaka Durga Kotamarthy }, }
63033bcaae5SKanaka Durga Kotamarthy }
63133bcaae5SKanaka Durga Kotamarthy }, }
63233bcaae5SKanaka Durga Kotamarthy },
633aa2cbd32SSunila Sahu { /* ECDSA */
634aa2cbd32SSunila Sahu .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
635aa2cbd32SSunila Sahu {.asym = {
636aa2cbd32SSunila Sahu .xform_capa = {
637aa2cbd32SSunila Sahu .xform_type = RTE_CRYPTO_ASYM_XFORM_ECDSA,
638aa2cbd32SSunila Sahu .op_types = ((1 << RTE_CRYPTO_ASYM_OP_SIGN) |
639aa2cbd32SSunila Sahu (1 << RTE_CRYPTO_ASYM_OP_VERIFY)),
640aa2cbd32SSunila Sahu }
641aa2cbd32SSunila Sahu },
642aa2cbd32SSunila Sahu }
643aa2cbd32SSunila Sahu },
64499faef83SSunila Sahu { /* ECPM */
64599faef83SSunila Sahu .op = RTE_CRYPTO_OP_TYPE_ASYMMETRIC,
64699faef83SSunila Sahu {.asym = {
64799faef83SSunila Sahu .xform_capa = {
64899faef83SSunila Sahu .xform_type = RTE_CRYPTO_ASYM_XFORM_ECPM,
64999faef83SSunila Sahu .op_types = 0
65099faef83SSunila Sahu }
65199faef83SSunila Sahu },
65299faef83SSunila Sahu }
65399faef83SSunila Sahu },
65433bcaae5SKanaka Durga Kotamarthy /* End of asymmetric capabilities */
65533bcaae5SKanaka Durga Kotamarthy RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
65633bcaae5SKanaka Durga Kotamarthy };
65733bcaae5SKanaka Durga Kotamarthy
658ef82c2e8SAnkur Dwivedi const struct rte_cryptodev_capabilities *
otx_get_capabilities(uint64_t flags)65933bcaae5SKanaka Durga Kotamarthy otx_get_capabilities(uint64_t flags)
660ef82c2e8SAnkur Dwivedi {
66133bcaae5SKanaka Durga Kotamarthy if (flags & RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO)
66233bcaae5SKanaka Durga Kotamarthy return otx_asym_capabilities;
66333bcaae5SKanaka Durga Kotamarthy else
66433bcaae5SKanaka Durga Kotamarthy return otx_sym_capabilities;
66533bcaae5SKanaka Durga Kotamarthy
666ef82c2e8SAnkur Dwivedi }
667