git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ipsec: support AES-CTR
[dpdk.git]
/
lib
/
librte_ipsec
/
sa.h
diff --git
a/lib/librte_ipsec/sa.h
b/lib/librte_ipsec/sa.h
index
392e8fd
..
12c061e
100644
(file)
--- a/
lib/librte_ipsec/sa.h
+++ b/
lib/librte_ipsec/sa.h
@@
-15,10
+15,17
@@
enum {
IPSEC_PAD_DEFAULT = 4,
IPSEC_PAD_AES_CBC = IPSEC_MAX_IV_SIZE,
enum {
IPSEC_PAD_DEFAULT = 4,
IPSEC_PAD_AES_CBC = IPSEC_MAX_IV_SIZE,
+ IPSEC_PAD_AES_CTR = IPSEC_PAD_DEFAULT,
IPSEC_PAD_AES_GCM = IPSEC_PAD_DEFAULT,
IPSEC_PAD_NULL = IPSEC_PAD_DEFAULT,
};
IPSEC_PAD_AES_GCM = IPSEC_PAD_DEFAULT,
IPSEC_PAD_NULL = IPSEC_PAD_DEFAULT,
};
+/* iv sizes for different algorithms */
+enum {
+ IPSEC_IV_SIZE_DEFAULT = IPSEC_MAX_IV_SIZE,
+ IPSEC_AES_CTR_IV_SIZE = sizeof(uint64_t),
+};
+
/* these definitions probably has to be in rte_crypto_sym.h */
union sym_op_ofslen {
uint64_t raw;
/* these definitions probably has to be in rte_crypto_sym.h */
union sym_op_ofslen {
uint64_t raw;
@@
-47,7
+54,17
@@
struct replay_sqn {
__extension__ uint64_t window[0];
};
__extension__ uint64_t window[0];
};
+/*IPSEC SA supported algorithms */
+enum sa_algo_type {
+ ALGO_TYPE_NULL = 0,
+ ALGO_TYPE_AES_CBC,
+ ALGO_TYPE_AES_CTR,
+ ALGO_TYPE_AES_GCM,
+ ALGO_TYPE_MAX
+};
+
struct rte_ipsec_sa {
struct rte_ipsec_sa {
+
uint64_t type; /* type of given SA */
uint64_t udata; /* user defined */
uint32_t size; /* size of given sa object */
uint64_t type; /* type of given SA */
uint64_t udata; /* user defined */
uint32_t size; /* size of given sa object */
@@
-65,6
+82,7
@@
struct rte_ipsec_sa {
union sym_op_ofslen auth;
} ctp;
uint32_t salt;
union sym_op_ofslen auth;
} ctp;
uint32_t salt;
+ uint8_t algo_type;
uint8_t proto; /* next proto */
uint8_t aad_len;
uint8_t hdr_len;
uint8_t proto; /* next proto */
uint8_t aad_len;
uint8_t hdr_len;