DPDK  19.11.3
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 
257  RTE_CRYPTO_AUTH_LIST_END
258 };
259 
261 extern const char *
263 
268 };
269 
271 extern const char *
273 
287  struct {
288  const uint8_t *data;
289  uint16_t length;
290  } key;
298  struct {
299  uint16_t offset;
315  uint16_t length;
333  } iv;
335  uint16_t digest_length;
345 };
346 
347 
354  RTE_CRYPTO_AEAD_LIST_END
355 };
356 
358 extern const char *
360 
367 };
368 
370 extern const char *
372 
373 struct rte_crypto_aead_xform {
376  enum rte_crypto_aead_algorithm algo;
379  struct {
380  const uint8_t *data;
381  uint16_t length;
382  } key;
383 
384  struct {
385  uint16_t offset;
400  uint16_t length;
414  } iv;
416  uint16_t digest_length;
417 
418  uint16_t aad_length;
424 };
425 
432 };
433 
447  ;
449  union {
454  struct rte_crypto_aead_xform aead;
456  };
457 };
458 
460 
492  struct rte_mbuf *m_src;
493  struct rte_mbuf *m_dst;
496  union {
501  struct rte_security_session *sec_session;
503  };
504 
506  union {
507  struct {
508  struct {
509  uint32_t offset;
514  uint32_t length;
519  } data;
520  struct {
521  uint8_t *data;
543  } digest;
544  struct {
545  uint8_t *data;
577  } aad;
579  } aead;
580 
581  struct {
582  struct {
583  struct {
584  uint32_t offset;
600  uint32_t length;
616  } data;
617  } cipher;
618 
619  struct {
620  struct {
621  uint32_t offset;
639  uint32_t length;
657  } data;
660  struct {
661  uint8_t *data;
734  } digest;
735  } auth;
736  };
737  };
738 };
739 
740 
746 static inline void
748 {
749  memset(op, 0, sizeof(*op));
750 }
751 
752 
763 static inline struct rte_crypto_sym_xform *
765  void *priv_data, uint8_t nb_xforms)
766 {
767  struct rte_crypto_sym_xform *xform;
768 
769  sym_op->xform = xform = (struct rte_crypto_sym_xform *)priv_data;
770 
771  do {
773  xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
774  } while (xform);
775 
776  return sym_op->xform;
777 }
778 
779 
786 static inline int
788  struct rte_cryptodev_sym_session *sess)
789 {
790  sym_op->session = sess;
791 
792  return 0;
793 }
794 
795 
796 #ifdef __cplusplus
797 }
798 #endif
799 
800 #endif /* _RTE_CRYPTO_SYM_H_ */
uint64_t rte_iova_t
Definition: rte_common.h:335
#define RTE_STD_C11
Definition: rte_common.h:40
static void __rte_crypto_sym_op_reset(struct rte_crypto_sym_op *op)
static int __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op *sym_op, struct rte_cryptodev_sym_session *sess)
rte_crypto_auth_algorithm
@ RTE_CRYPTO_AUTH_SHA512_HMAC
@ RTE_CRYPTO_AUTH_ZUC_EIA3
@ RTE_CRYPTO_AUTH_SHA3_224
@ RTE_CRYPTO_AUTH_AES_CBC_MAC
@ RTE_CRYPTO_AUTH_SHA224_HMAC
@ RTE_CRYPTO_AUTH_AES_XCBC_MAC
@ RTE_CRYPTO_AUTH_SHA3_224_HMAC
@ RTE_CRYPTO_AUTH_SNOW3G_UIA2
@ RTE_CRYPTO_AUTH_SHA1
@ RTE_CRYPTO_AUTH_SHA3_384_HMAC
@ RTE_CRYPTO_AUTH_SHA512
@ RTE_CRYPTO_AUTH_SHA384_HMAC
@ RTE_CRYPTO_AUTH_KASUMI_F9
@ RTE_CRYPTO_AUTH_MD5
@ RTE_CRYPTO_AUTH_MD5_HMAC
@ RTE_CRYPTO_AUTH_SHA384
@ RTE_CRYPTO_AUTH_SHA224
@ RTE_CRYPTO_AUTH_SHA3_512
@ RTE_CRYPTO_AUTH_AES_CMAC
@ RTE_CRYPTO_AUTH_SHA3_256_HMAC
@ RTE_CRYPTO_AUTH_SHA1_HMAC
@ RTE_CRYPTO_AUTH_NULL
@ RTE_CRYPTO_AUTH_SHA3_384
@ RTE_CRYPTO_AUTH_SHA3_256
@ RTE_CRYPTO_AUTH_SHA256
@ RTE_CRYPTO_AUTH_SHA256_HMAC
@ RTE_CRYPTO_AUTH_AES_GMAC
@ RTE_CRYPTO_AUTH_SHA3_512_HMAC
const char * rte_crypto_auth_algorithm_strings[]
const char * rte_crypto_cipher_operation_strings[]
rte_crypto_cipher_operation
@ RTE_CRYPTO_CIPHER_OP_DECRYPT
@ RTE_CRYPTO_CIPHER_OP_ENCRYPT
rte_crypto_sym_xform_type
@ RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED
@ RTE_CRYPTO_SYM_XFORM_AUTH
@ RTE_CRYPTO_SYM_XFORM_AEAD
@ RTE_CRYPTO_SYM_XFORM_CIPHER
rte_crypto_aead_algorithm
@ RTE_CRYPTO_AEAD_AES_CCM
@ RTE_CRYPTO_AEAD_AES_GCM
rte_crypto_cipher_algorithm
@ RTE_CRYPTO_CIPHER_DES_CBC
@ RTE_CRYPTO_CIPHER_ARC4
@ RTE_CRYPTO_CIPHER_AES_XTS
@ RTE_CRYPTO_CIPHER_AES_CTR
@ RTE_CRYPTO_CIPHER_AES_DOCSISBPI
@ RTE_CRYPTO_CIPHER_SNOW3G_UEA2
@ RTE_CRYPTO_CIPHER_3DES_ECB
@ RTE_CRYPTO_CIPHER_ZUC_EEA3
@ RTE_CRYPTO_CIPHER_DES_DOCSISBPI
@ RTE_CRYPTO_CIPHER_NULL
@ RTE_CRYPTO_CIPHER_KASUMI_F8
@ RTE_CRYPTO_CIPHER_AES_CBC
@ RTE_CRYPTO_CIPHER_AES_F8
@ RTE_CRYPTO_CIPHER_3DES_CBC
@ RTE_CRYPTO_CIPHER_3DES_CTR
@ RTE_CRYPTO_CIPHER_AES_ECB
const char * rte_crypto_aead_operation_strings[]
rte_crypto_auth_operation
@ RTE_CRYPTO_AUTH_OP_VERIFY
@ RTE_CRYPTO_AUTH_OP_GENERATE
const char * rte_crypto_aead_algorithm_strings[]
rte_crypto_aead_operation
@ RTE_CRYPTO_AEAD_OP_DECRYPT
@ RTE_CRYPTO_AEAD_OP_ENCRYPT
const char * rte_crypto_auth_operation_strings[]
const char * rte_crypto_cipher_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)
enum rte_crypto_auth_algorithm algo
struct rte_crypto_auth_xform::@98 key
struct rte_crypto_auth_xform::@99 iv
const uint8_t * data
enum rte_crypto_auth_operation op
enum rte_crypto_cipher_algorithm algo
struct rte_crypto_cipher_xform::@97 iv
enum rte_crypto_cipher_operation op
struct rte_crypto_cipher_xform::@96 key
struct rte_crypto_sym_op::@106::@108::@111 data
struct rte_crypto_sym_op::@106::@108::@112 digest
struct rte_cryptodev_sym_session * session
struct rte_security_session * sec_session
struct rte_mbuf * m_dst
struct rte_crypto_sym_op::@106::@108::@113 aad
struct rte_crypto_sym_xform * xform
rte_iova_t phys_addr
struct rte_mbuf * m_src
struct rte_crypto_auth_xform auth
enum rte_crypto_sym_xform_type type
struct rte_crypto_sym_xform * next
struct rte_crypto_cipher_xform cipher
struct rte_crypto_aead_xform aead