1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
4 #ifndef _CNXK_SECURITY_H__
5 #define _CNXK_SECURITY_H__
7 #include <rte_crypto.h>
8 #include <rte_security.h>
12 /* Response length calculation data */
13 struct cnxk_ipsec_outb_rlens {
17 uint16_t max_extended_len;
21 cnxk_ipsec_outb_rlens_get(struct cnxk_ipsec_outb_rlens *rlens,
22 struct rte_security_ipsec_xform *ipsec_xfrm,
23 struct rte_crypto_sym_xform *crypto_xfrm);
25 cnxk_ipsec_ivlen_get(enum rte_crypto_cipher_algorithm c_algo,
26 enum rte_crypto_auth_algorithm a_algo,
27 enum rte_crypto_aead_algorithm aead_algo);
29 cnxk_ipsec_icvlen_get(enum rte_crypto_cipher_algorithm c_algo,
30 enum rte_crypto_auth_algorithm a_algo,
31 enum rte_crypto_aead_algorithm aead_algo);
34 cnxk_ipsec_outb_roundup_byte(enum rte_crypto_cipher_algorithm c_algo,
35 enum rte_crypto_aead_algorithm aead_algo);
39 cnxk_ot_ipsec_inb_sa_fill(struct roc_ot_ipsec_inb_sa *sa,
40 struct rte_security_ipsec_xform *ipsec_xfrm,
41 struct rte_crypto_sym_xform *crypto_xfrm);
43 cnxk_ot_ipsec_outb_sa_fill(struct roc_ot_ipsec_outb_sa *sa,
44 struct rte_security_ipsec_xform *ipsec_xfrm,
45 struct rte_crypto_sym_xform *crypto_xfrm);
46 bool __roc_api cnxk_ot_ipsec_inb_sa_valid(struct roc_ot_ipsec_inb_sa *sa);
47 bool __roc_api cnxk_ot_ipsec_outb_sa_valid(struct roc_ot_ipsec_outb_sa *sa);
51 cnxk_onf_ipsec_inb_sa_fill(struct roc_onf_ipsec_inb_sa *sa,
52 struct rte_security_ipsec_xform *ipsec_xfrm,
53 struct rte_crypto_sym_xform *crypto_xfrm);
55 cnxk_onf_ipsec_outb_sa_fill(struct roc_onf_ipsec_outb_sa *sa,
56 struct rte_security_ipsec_xform *ipsec_xfrm,
57 struct rte_crypto_sym_xform *crypto_xfrm);
58 bool __roc_api cnxk_onf_ipsec_inb_sa_valid(struct roc_onf_ipsec_inb_sa *sa);
59 bool __roc_api cnxk_onf_ipsec_outb_sa_valid(struct roc_onf_ipsec_outb_sa *sa);
61 #endif /* _CNXK_SECURITY_H__ */