1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Broadcom
6 #ifndef _BCMFS_SYM_SESSION_H_
7 #define _BCMFS_SYM_SESSION_H_
10 #include <rte_crypto.h>
11 #include <cryptodev_pmd.h>
13 #include "bcmfs_sym_defs.h"
14 #include "bcmfs_sym_req.h"
16 /* BCMFS_SYM operation order mode enumerator */
17 enum bcmfs_sym_chain_order {
18 BCMFS_SYM_CHAIN_ONLY_CIPHER,
19 BCMFS_SYM_CHAIN_ONLY_AUTH,
20 BCMFS_SYM_CHAIN_CIPHER_AUTH,
21 BCMFS_SYM_CHAIN_AUTH_CIPHER,
23 BCMFS_SYM_CHAIN_NOT_SUPPORTED
26 /* BCMFS_SYM crypto private session structure */
27 struct bcmfs_sym_session {
28 enum bcmfs_sym_chain_order chain_order;
30 /* Cipher Parameters */
32 enum rte_crypto_cipher_operation op;
33 /* Cipher operation */
34 enum rte_crypto_cipher_algorithm algo;
35 /* Cipher algorithm */
37 uint8_t data[BCMFS_MAX_KEY_SIZE];
46 /* Authentication Parameters */
48 enum rte_crypto_auth_operation op;
50 enum rte_crypto_auth_algorithm algo;
54 uint8_t data[BCMFS_MAX_KEY_SIZE];
62 uint16_t digest_length;
67 enum rte_crypto_aead_operation op;
69 enum rte_crypto_aead_algorithm algo;
72 uint8_t data[BCMFS_MAX_KEY_SIZE];
80 uint16_t digest_length;
86 } __rte_cache_aligned;
89 bcmfs_process_crypto_op(struct rte_crypto_op *op,
90 struct bcmfs_sym_session *sess,
91 struct bcmfs_sym_request *req);
94 bcmfs_sym_session_configure(struct rte_cryptodev *dev,
95 struct rte_crypto_sym_xform *xform,
96 struct rte_cryptodev_sym_session *sess,
97 struct rte_mempool *mempool);
100 bcmfs_sym_session_clear(struct rte_cryptodev *dev,
101 struct rte_cryptodev_sym_session *sess);
104 bcmfs_sym_session_get_private_size(struct rte_cryptodev *dev __rte_unused);
106 struct bcmfs_sym_session *
107 bcmfs_sym_get_session(struct rte_crypto_op *op);
109 #endif /* _BCMFS_SYM_SESSION_H_ */