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