NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_flow_crypto.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
25 #ifndef DOCA_FLOW_CRYPTO_H_
26 #define DOCA_FLOW_CRYPTO_H_
27 
28 #include <doca_compat.h>
29 #include <doca_error.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 struct doca_flow_port;
39 
43 struct doca_flow_crypto_psp_spi_key_bulk;
44 
55 };
56 
67 };
68 
79 };
80 
107 };
108 
117 };
118 
129 };
130 
143 };
144 
153 };
154 
161  uint32_t *key;
163 };
164 
183 
210  enum doca_flow_crypto_key_type key_type,
211  uint32_t nr_spi_keys,
212  struct doca_flow_crypto_psp_spi_key_bulk **spi_key_bulk);
213 
232 doca_error_t doca_flow_crypto_psp_spi_key_bulk_generate(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk);
233 
252 doca_error_t doca_flow_crypto_psp_spi_key_bulk_get(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk,
253  uint32_t spi_key_idx,
254  uint32_t *spi,
255  uint32_t *key);
256 
271 doca_error_t doca_flow_crypto_psp_spi_key_wipe(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk,
272  uint32_t spi_key_idx);
273 
290 doca_error_t doca_flow_crypto_psp_spi_key_bulk_clear(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk);
291 
304 doca_error_t doca_flow_crypto_psp_spi_key_bulk_free(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk);
305 
330 int doca_flow_crypto_ipsec_resource_handle(struct doca_flow_port *port,
331  uint64_t quota,
332  uint32_t max_processed_resources);
333 
351 doca_error_t doca_flow_crypto_ipsec_update_sn(uint32_t shared_res_id, uint64_t sequence_number);
352 
353 #ifdef __cplusplus
354 } /* extern "C" */
355 #endif
356 
359 #endif /* DOCA_FLOW_CRYPTO_H_ */
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
enum doca_error doca_error_t
DOCA API return codes.
doca_flow_crypto_sn_offload_type
doca flow crypto SN offload type
DOCA_EXPERIMENTAL doca_error_t doca_flow_crypto_psp_spi_key_bulk_get(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk, uint32_t spi_key_idx, uint32_t *spi, uint32_t *key)
Get SPI and key for specific index in the bulk.
DOCA_EXPERIMENTAL doca_error_t doca_flow_crypto_psp_spi_key_bulk_free(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk)
Free the memory for spi key bulk.
DOCA_EXPERIMENTAL doca_error_t doca_flow_crypto_psp_master_key_rotate(struct doca_flow_port *port)
Rotate PSP master key.
DOCA_EXPERIMENTAL doca_error_t doca_flow_crypto_ipsec_update_sn(uint32_t shared_res_id, uint64_t sequence_number)
Update the sequence number state for specific resource.
DOCA_EXPERIMENTAL doca_error_t doca_flow_crypto_psp_spi_key_bulk_generate(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk)
Fill a bulk with new pairs of SPI and key.
doca_flow_crypto_replay_win_size
doca flow crypto replay window size
doca_flow_crypto_icv_len
doca flow crypto ICV length
doca_flow_crypto_encap_net_type
doca flow crypto operation encapsulation header type
doca_flow_crypto_resource_type
doca flow crypto operation resource type
DOCA_EXPERIMENTAL doca_error_t doca_flow_crypto_psp_spi_key_bulk_clear(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk)
Clear the bulk data.
DOCA_EXPERIMENTAL doca_error_t doca_flow_crypto_psp_spi_key_bulk_alloc(struct doca_flow_port *port, enum doca_flow_crypto_key_type key_type, uint32_t nr_spi_keys, struct doca_flow_crypto_psp_spi_key_bulk **spi_key_bulk)
Allocate an array of spi and key pairs.
doca_flow_crypto_key_type
doca flow crypto key type
doca_flow_crypto_encap_action_type
doca flow crypto operation reformat type
DOCA_EXPERIMENTAL int doca_flow_crypto_ipsec_resource_handle(struct doca_flow_port *port, uint64_t quota, uint32_t max_processed_resources)
Handle ipsec resources.
doca_flow_crypto_action_type
doca flow crypto operation action type
DOCA_EXPERIMENTAL doca_error_t doca_flow_crypto_psp_spi_key_wipe(struct doca_flow_crypto_psp_spi_key_bulk *spi_key_bulk, uint32_t spi_key_idx)
Wipe the memory of a key for specific index in the bulk.
@ DOCA_FLOW_CRYPTO_SN_OFFLOAD_AR
@ DOCA_FLOW_CRYPTO_SN_OFFLOAD_INC
@ DOCA_FLOW_CRYPTO_REPLAY_WIN_SIZE_64
@ DOCA_FLOW_CRYPTO_REPLAY_WIN_SIZE_128
@ DOCA_FLOW_CRYPTO_REPLAY_WIN_SIZE_32
@ DOCA_FLOW_CRYPTO_REPLAY_WIN_SIZE_256
@ DOCA_FLOW_CRYPTO_ICV_LENGTH_16
@ DOCA_FLOW_CRYPTO_ICV_LENGTH_12
@ DOCA_FLOW_CRYPTO_ICV_LENGTH_8
@ DOCA_FLOW_CRYPTO_HEADER_ESP_OVER_LAN
@ DOCA_FLOW_CRYPTO_HEADER_ESP_OVER_IPV6
@ DOCA_FLOW_CRYPTO_HEADER_PSP_OVER_IPV4
@ DOCA_FLOW_CRYPTO_HEADER_UDP_ESP_OVER_IPV4
@ DOCA_FLOW_CRYPTO_HEADER_NON_ESP_MARKER
@ DOCA_FLOW_CRYPTO_HEADER_ESP_OVER_IPV4
@ DOCA_FLOW_CRYPTO_HEADER_NONE
@ DOCA_FLOW_CRYPTO_HEADER_PSP_OVER_IPV6
@ DOCA_FLOW_CRYPTO_HEADER_ESP_TUNNEL
@ DOCA_FLOW_CRYPTO_HEADER_PSP_TUNNEL
@ DOCA_FLOW_CRYPTO_HEADER_UDP_ESP_OVER_IPV6
@ DOCA_FLOW_CRYPTO_RESOURCE_NONE
@ DOCA_FLOW_CRYPTO_RESOURCE_PSP
@ DOCA_FLOW_CRYPTO_RESOURCE_IPSEC_SA
@ DOCA_FLOW_CRYPTO_KEY_128
@ DOCA_FLOW_CRYPTO_KEY_256
@ DOCA_FLOW_CRYPTO_REFORMAT_ENCAP
@ DOCA_FLOW_CRYPTO_REFORMAT_NONE
@ DOCA_FLOW_CRYPTO_REFORMAT_DECAP
@ DOCA_FLOW_CRYPTO_ACTION_NONE
@ DOCA_FLOW_CRYPTO_ACTION_DECRYPT
@ DOCA_FLOW_CRYPTO_ACTION_ENCRYPT
doca flow crypto key configuration
enum doca_flow_crypto_key_type key_type