1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2019 Marvell International Ltd.
5 #ifndef _NITROX_SYM_CTX_H_
6 #define _NITROX_SYM_CTX_H_
10 #include <rte_crypto.h>
12 #define AES_MAX_KEY_SIZE 32
13 #define AES_BLOCK_SIZE 16
16 NITROX_CHAIN_CIPHER_ONLY,
17 NITROX_CHAIN_CIPHER_AUTH,
18 NITROX_CHAIN_AUTH_CIPHER,
19 NITROX_CHAIN_COMBINED,
20 NITROX_CHAIN_NOT_SUPPORTED
29 uint8_t key[AES_MAX_KEY_SIZE];
30 uint8_t iv[AES_BLOCK_SIZE];
38 struct flexi_crypto_context {
42 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
43 uint64_t cipher_type : 4;
44 uint64_t reserved_59 : 1;
45 uint64_t aes_keylen : 2;
46 uint64_t iv_source : 1;
47 uint64_t hash_type : 4;
48 uint64_t reserved_49_51 : 3;
49 uint64_t auth_input_type : 1;
51 uint64_t reserved_0_39 : 40;
53 uint64_t reserved_0_39 : 40;
55 uint64_t auth_input_type : 1;
56 uint64_t reserved_49_51 : 3;
57 uint64_t hash_type : 4;
58 uint64_t iv_source : 1;
59 uint64_t aes_keylen : 2;
60 uint64_t reserved_59 : 1;
61 uint64_t cipher_type : 4;
65 struct crypto_keys crypto;
66 struct auth_keys auth;
69 struct nitrox_crypto_ctx {
70 struct flexi_crypto_context fctx;
71 enum nitrox_chain nitrox_chain;
72 enum rte_crypto_auth_operation auth_op;
73 enum rte_crypto_auth_algorithm auth_algo;
79 uint16_t digest_length;
84 #endif /* _NITROX_SYM_CTX_H_ */