Add capabilities of sym.

Signed-off-by: Hanxiao Li <li.hanx...@zte.com.cn>
---
 drivers/crypto/zsda/zsda_sym_capabilities.h | 111 ++++++++++++++++++++
 1 file changed, 111 insertions(+)
 create mode 100644 drivers/crypto/zsda/zsda_sym_capabilities.h

diff --git a/drivers/crypto/zsda/zsda_sym_capabilities.h 
b/drivers/crypto/zsda/zsda_sym_capabilities.h
new file mode 100644
index 0000000000..d9e6dc4b40
--- /dev/null
+++ b/drivers/crypto/zsda/zsda_sym_capabilities.h
@@ -0,0 +1,111 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2024 ZTE Corporation
+ */
+
+#ifndef _ZSDA_SYM_CAPABILITIES_H_
+#define _ZSDA_SYM_CAPABILITIES_H_
+
+static const struct rte_cryptodev_capabilities zsda_crypto_sym_capabilities[] 
= {
+       {/* SHA1 */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               { .sym = {.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+                       { .auth = {
+                               .algo = RTE_CRYPTO_AUTH_SHA1,
+                               .block_size = 64,
+                               .key_size = {.min = 0, .max = 0, .increment = 
0},
+                               .digest_size = {.min = 20, .max = 20, 
.increment = 2},
+                               .iv_size = {0} },
+                       }       },
+               }
+       },
+       {/* SHA224 */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               { .sym = {
+                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+                       { .auth = {
+                               .algo = RTE_CRYPTO_AUTH_SHA224,
+                               .block_size = 64,
+                               .key_size = {.min = 0, .max = 0, .increment = 
0},
+                               .digest_size = {.min = 28, .max = 28, 
.increment = 0},
+                               .iv_size = {0} },
+                       }       },
+               }
+       },
+       {/* SHA256 */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               { .sym = {
+                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+                       { .auth = {
+                               .algo = RTE_CRYPTO_AUTH_SHA256,
+                               .block_size = 64,
+                               .key_size = {.min = 0, .max = 0, .increment = 
0},
+                               .digest_size = {.min = 32, .max = 32, 
.increment = 0},
+                               .iv_size = {0} },
+                       } },
+               }
+       },
+       {/* SHA384 */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               { .sym = {
+                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+                       { .auth = {
+                               .algo = RTE_CRYPTO_AUTH_SHA384,
+                               .block_size = 128,
+                               .key_size = {.min = 0, .max = 0, .increment = 
0},
+                               .digest_size = {.min = 48, .max = 48, 
.increment = 0},
+                               .iv_size = {0} },
+                       } },
+               }
+       },
+       {/* SHA512 */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               { .sym = {
+                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+                       { .auth = {
+                               .algo = RTE_CRYPTO_AUTH_SHA512,
+                               .block_size = 128,
+                               .key_size = {.min = 0, .max = 0, .increment = 
0},
+                               .digest_size = {.min = 64, .max = 64, 
.increment = 0},
+                               .iv_size = {0} },
+                       } },
+               }
+       },
+       {/* SM3 */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               { .sym = {
+                       .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+                       { .auth = {
+                               .algo = RTE_CRYPTO_AUTH_SM3,
+                               .block_size = 64,
+                               .key_size = {.min = 0, .max = 0, .increment = 
0},
+                               .digest_size = {.min = 32, .max = 32, 
.increment = 0},
+                               .iv_size = {0} },
+                       } },
+               }
+       },
+       {/* AES XTS */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               { .sym = {
+                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+                       { .cipher = {
+                               .algo = RTE_CRYPTO_CIPHER_AES_XTS,
+                               .block_size = 16,
+                               .key_size = {.min = 16, .max = 32, .increment = 
16},
+                               .iv_size = {.min = 16, .max = 16, .increment = 
0} },
+                       } },
+               }
+       },
+       {/* SM4 XTS */
+               .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+               { .sym = {
+                       .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+                       { .cipher = {
+                               .algo = RTE_CRYPTO_CIPHER_SM4_XTS,
+                               .block_size = 16,
+                               .key_size = {.min = 32, .max = 32, .increment = 
0},
+                               .iv_size = {.min = 16, .max = 16, .increment = 
0} },
+                       } },
+               }
+       }
+};
+#endif /* _ZSDA_SYM_CAPABILITIES_H_ */
-- 
2.27.0

Reply via email to