1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (C) 2020 Marvell International Ltd.
3  */
4 
5 #ifndef __OTX2_SECURITY_H__
6 #define __OTX2_SECURITY_H__
7 
8 #include <rte_security.h>
9 
10 #include "otx2_cryptodev_sec.h"
11 #include "otx2_ethdev_sec.h"
12 
13 #define OTX2_SEC_AH_HDR_LEN			12
14 #define OTX2_SEC_AES_GCM_IV_LEN			8
15 #define OTX2_SEC_AES_GCM_MAC_LEN		16
16 #define OTX2_SEC_AES_CBC_IV_LEN			16
17 #define OTX2_SEC_SHA1_HMAC_LEN			12
18 
19 #define OTX2_SEC_AES_GCM_ROUNDUP_BYTE_LEN	4
20 #define OTX2_SEC_AES_CBC_ROUNDUP_BYTE_LEN	16
21 
22 union otx2_sec_session_ipsec {
23 	struct otx2_sec_session_ipsec_ip ip;
24 	struct otx2_sec_session_ipsec_lp lp;
25 	enum rte_security_ipsec_sa_direction dir;
26 };
27 
28 struct otx2_sec_session {
29 	union otx2_sec_session_ipsec ipsec;
30 	void *userdata;
31 	/**< Userdata registered by the application */
32 } __rte_cache_aligned;
33 
34 #endif /* __OTX2_SECURITY_H__ */
35