DPDK  19.11.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rte_crypto_sym.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016-2019 Intel Corporation
3  */
4 
5 #ifndef _RTE_CRYPTO_SYM_H_
6 #define _RTE_CRYPTO_SYM_H_
7 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include <string.h>
22 
23 #include <rte_mbuf.h>
24 #include <rte_memory.h>
25 #include <rte_mempool.h>
26 #include <rte_common.h>
27 
28 
81  RTE_CRYPTO_CIPHER_LIST_END
82 
83 };
84 
86 extern const char *
88 
95 };
96 
98 extern const char *
100 
116  struct {
117  const uint8_t *data;
118  uint16_t length;
119  } key;
143  struct {
144  uint16_t offset;
170  uint16_t length;
185  } iv;
186 };
187 
254  RTE_CRYPTO_AUTH_LIST_END
255 };
256 
258 extern const char *
260 
265 };
266 
268 extern const char *
270 
284  struct {
285  const uint8_t *data;
286  uint16_t length;
287  } key;
295  struct {
296  uint16_t offset;
312  uint16_t length;
330  } iv;
332  uint16_t digest_length;
342 };
343 
344 
351  RTE_CRYPTO_AEAD_LIST_END
352 };
353 
355 extern const char *
357 
364 };
365 
367 extern const char *
369 
370 struct rte_crypto_aead_xform {
373  enum rte_crypto_aead_algorithm algo;
376  struct {
377  const uint8_t *data;
378  uint16_t length;
379  } key;
380 
381  struct {
382  uint16_t offset;
397  uint16_t length;
411  } iv;
413  uint16_t digest_length;
414 
415  uint16_t aad_length;
421 };
422 
429 };
430 
444  ;
446  union {
451  struct rte_crypto_aead_xform aead;
453  };
454 };
455 
457 
489  struct rte_mbuf *m_src;
490  struct rte_mbuf *m_dst;
493  union {
498  struct rte_security_session *sec_session;
500  };
501 
503  union {
504  struct {
505  struct {
506  uint32_t offset;
511  uint32_t length;
516  } data;
517  struct {
518  uint8_t *data;
540  } digest;
541  struct {
542  uint8_t *data;
574  } aad;
576  } aead;
577 
578  struct {
579  struct {
580  struct {
581  uint32_t offset;
597  uint32_t length;
613  } data;
614  } cipher;
615 
616  struct {
617  struct {
618  uint32_t offset;
636  uint32_t length;
654  } data;
657  struct {
658  uint8_t *data;
731  } digest;
732  } auth;
733  };
734  };
735 };
736 
737 
743 static inline void
745 {
746  memset(op, 0, sizeof(*op));
747 }
748 
749 
760 static inline struct rte_crypto_sym_xform *
762  void *priv_data, uint8_t nb_xforms)
763 {
764  struct rte_crypto_sym_xform *xform;
765 
766  sym_op->xform = xform = (struct rte_crypto_sym_xform *)priv_data;
767 
768  do {
770  xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
771  } while (xform);
772 
773  return sym_op->xform;
774 }
775 
776 
783 static inline int
785  struct rte_cryptodev_sym_session *sess)
786 {
787  sym_op->session = sess;
788 
789  return 0;
790 }
791 
792 
793 #ifdef __cplusplus
794 }
795 #endif
796 
797 #endif /* _RTE_CRYPTO_SYM_H_ */
enum rte_crypto_cipher_operation op
struct rte_security_session * sec_session
struct rte_crypto_sym_op::@106::@108::@111 data
struct rte_crypto_auth_xform auth
uint64_t rte_iova_t
Definition: rte_common.h:365
struct rte_crypto_cipher_xform cipher
struct rte_crypto_cipher_xform::@97 iv
static void __rte_crypto_sym_op_reset(struct rte_crypto_sym_op *op)
enum rte_crypto_auth_operation op
struct rte_mbuf * m_src
rte_crypto_auth_operation
const char * rte_crypto_cipher_operation_strings[]
const char * rte_crypto_aead_operation_strings[]
rte_crypto_cipher_operation
enum rte_crypto_auth_algorithm algo
const char * rte_crypto_aead_algorithm_strings[]
static struct rte_crypto_sym_xform * __rte_crypto_sym_op_sym_xforms_alloc(struct rte_crypto_sym_op *sym_op, void *priv_data, uint8_t nb_xforms)
rte_crypto_aead_operation
struct rte_mbuf * m_dst
struct rte_crypto_auth_xform::@98 key
struct rte_crypto_aead_xform aead
static int __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op *sym_op, struct rte_cryptodev_sym_session *sess)
struct rte_crypto_auth_xform::@99 iv
struct rte_crypto_cipher_xform::@96 key
struct rte_cryptodev_sym_session * session
struct rte_crypto_sym_op::@106::@108::@112 digest
#define RTE_STD_C11
Definition: rte_common.h:40
rte_crypto_auth_algorithm
rte_crypto_sym_xform_type
const char * rte_crypto_auth_algorithm_strings[]
const uint8_t * data
struct rte_crypto_sym_xform * xform
enum rte_crypto_sym_xform_type type
enum rte_crypto_cipher_algorithm algo
const char * rte_crypto_auth_operation_strings[]
struct rte_crypto_sym_xform * next
rte_iova_t phys_addr
rte_crypto_aead_algorithm
const char * rte_crypto_cipher_algorithm_strings[]
struct rte_crypto_sym_op::@106::@108::@113 aad
rte_crypto_cipher_algorithm