DPDK  18.11.6
rte_crypto_sym.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016-2017 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  uint8_t *data;
118  uint16_t length;
119  } key;
146  struct {
147  uint16_t offset;
178  uint16_t length;
196  } iv;
197 };
198 
265  RTE_CRYPTO_AUTH_LIST_END
266 };
267 
269 extern const char *
271 
276 };
277 
279 extern const char *
281 
295  struct {
296  uint8_t *data;
297  uint16_t length;
298  } key;
306  struct {
307  uint16_t offset;
322  uint16_t length;
332  } iv;
334  uint16_t digest_length;
344 };
345 
346 
353  RTE_CRYPTO_AEAD_LIST_END
354 };
355 
357 extern const char *
359 
366 };
367 
369 extern const char *
371 
372 struct rte_crypto_aead_xform {
375  enum rte_crypto_aead_algorithm algo;
378  struct {
379  uint8_t *data;
380  uint16_t length;
381  } key;
382 
383  struct {
384  uint16_t offset;
404  uint16_t length;
413  } iv;
415  uint16_t digest_length;
416 
417  uint16_t aad_length;
423 };
424 
431 };
432 
446  ;
448  union {
453  struct rte_crypto_aead_xform aead;
455  };
456 };
457 
459 
491  struct rte_mbuf *m_src;
492  struct rte_mbuf *m_dst;
495  union {
500  struct rte_security_session *sec_session;
502  };
503 
505  union {
506  struct {
507  struct {
508  uint32_t offset;
513  uint32_t length;
518  } data;
519  struct {
520  uint8_t *data;
542  } digest;
543  struct {
544  uint8_t *data;
576  } aad;
578  } aead;
579 
580  struct {
581  struct {
582  struct {
583  uint32_t offset;
597  uint32_t length;
611  } data;
612  } cipher;
613 
614  struct {
615  struct {
616  uint32_t offset;
632  uint32_t length;
648  } data;
651  struct {
652  uint8_t *data;
674  } digest;
675  } auth;
676  };
677  };
678 };
679 
680 
686 static inline void
688 {
689  memset(op, 0, sizeof(*op));
690 }
691 
692 
703 static inline struct rte_crypto_sym_xform *
705  void *priv_data, uint8_t nb_xforms)
706 {
707  struct rte_crypto_sym_xform *xform;
708 
709  sym_op->xform = xform = (struct rte_crypto_sym_xform *)priv_data;
710 
711  do {
713  xform = xform->next = --nb_xforms > 0 ? xform + 1 : NULL;
714  } while (xform);
715 
716  return sym_op->xform;
717 }
718 
719 
726 static inline int
728  struct rte_cryptodev_sym_session *sess)
729 {
730  sym_op->session = sess;
731 
732  return 0;
733 }
734 
735 
736 #ifdef __cplusplus
737 }
738 #endif
739 
740 #endif /* _RTE_CRYPTO_SYM_H_ */
__rte_crypto_sym_op_reset
static void __rte_crypto_sym_op_reset(struct rte_crypto_sym_op *op)
Definition: rte_crypto_sym.h:687
rte_crypto_sym_xform::auth
struct rte_crypto_auth_xform auth
Definition: rte_crypto_sym.h:449
rte_crypto_cipher_xform::key
struct rte_crypto_cipher_xform::@77 key
rte_crypto_auth_algorithm_strings
const char * rte_crypto_auth_algorithm_strings[]
RTE_CRYPTO_CIPHER_KASUMI_F8
Definition: rte_crypto_sym.h:55
rte_crypto_cipher_xform::op
enum rte_crypto_cipher_operation op
Definition: rte_crypto_sym.h:108
rte_crypto_cipher_algorithm
rte_crypto_cipher_algorithm
Definition: rte_crypto_sym.h:30
rte_crypto_auth_xform::key
struct rte_crypto_auth_xform::@79 key
rte_memory.h
RTE_CRYPTO_CIPHER_ARC4
Definition: rte_crypto_sym.h:52
RTE_CRYPTO_AUTH_AES_GMAC
Definition: rte_crypto_sym.h:208
RTE_CRYPTO_CIPHER_3DES_ECB
Definition: rte_crypto_sym.h:38
rte_crypto_sym_op::aad
struct rte_crypto_sym_op::@87::@89::@94 aad
RTE_CRYPTO_AEAD_AES_CCM
Definition: rte_crypto_sym.h:349
RTE_CRYPTO_CIPHER_NULL
Definition: rte_crypto_sym.h:31
RTE_CRYPTO_CIPHER_AES_XTS
Definition: rte_crypto_sym.h:49
RTE_CRYPTO_AUTH_SHA512
Definition: rte_crypto_sym.h:237
rte_crypto_auth_operation_strings
const char * rte_crypto_auth_operation_strings[]
rte_crypto_auth_xform::length
uint16_t length
Definition: rte_crypto_sym.h:297
rte_crypto_cipher_xform::algo
enum rte_crypto_cipher_algorithm algo
Definition: rte_crypto_sym.h:113
RTE_CRYPTO_AUTH_KASUMI_F9
Definition: rte_crypto_sym.h:213
rte_crypto_auth_operation
rte_crypto_auth_operation
Definition: rte_crypto_sym.h:273
RTE_CRYPTO_AUTH_AES_CMAC
Definition: rte_crypto_sym.h:206
rte_crypto_cipher_xform::data
uint8_t * data
Definition: rte_crypto_sym.h:117
RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED
Definition: rte_crypto_sym.h:427
RTE_CRYPTO_AUTH_SHA512_HMAC
Definition: rte_crypto_sym.h:239
rte_crypto_sym_op::phys_addr
rte_iova_t phys_addr
Definition: rte_crypto_sym.h:540
rte_crypto_cipher_xform::iv
struct rte_crypto_cipher_xform::@78 iv
RTE_CRYPTO_AUTH_SHA3_224
Definition: rte_crypto_sym.h:248
__rte_crypto_sym_op_attach_sym_session
static int __rte_crypto_sym_op_attach_sym_session(struct rte_crypto_sym_op *sym_op, struct rte_cryptodev_sym_session *sess)
Definition: rte_crypto_sym.h:727
RTE_CRYPTO_AUTH_SHA3_384
Definition: rte_crypto_sym.h:256
RTE_CRYPTO_AUTH_AES_CBC_MAC
Definition: rte_crypto_sym.h:204
RTE_CRYPTO_CIPHER_3DES_CTR
Definition: rte_crypto_sym.h:36
RTE_CRYPTO_AUTH_SHA1_HMAC
Definition: rte_crypto_sym.h:223
RTE_CRYPTO_CIPHER_DES_CBC
Definition: rte_crypto_sym.h:64
rte_crypto_sym_op::xform
struct rte_crypto_sym_xform * xform
Definition: rte_crypto_sym.h:498
RTE_CRYPTO_AEAD_OP_ENCRYPT
Definition: rte_crypto_sym.h:362
RTE_CRYPTO_CIPHER_ZUC_EEA3
Definition: rte_crypto_sym.h:61
rte_mbuf
Definition: rte_mbuf.h:478
RTE_CRYPTO_AUTH_ZUC_EIA3
Definition: rte_crypto_sym.h:245
rte_crypto_sym_op::m_src
struct rte_mbuf * m_src
Definition: rte_crypto_sym.h:491
RTE_CRYPTO_AUTH_OP_VERIFY
Definition: rte_crypto_sym.h:274
rte_crypto_auth_xform::op
enum rte_crypto_auth_operation op
Definition: rte_crypto_sym.h:290
RTE_CRYPTO_CIPHER_AES_CTR
Definition: rte_crypto_sym.h:43
RTE_CRYPTO_CIPHER_DES_DOCSISBPI
Definition: rte_crypto_sym.h:74
__rte_crypto_sym_op_sym_xforms_alloc
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)
Definition: rte_crypto_sym.h:704
rte_crypto_sym_op::length
uint32_t length
Definition: rte_crypto_sym.h:513
RTE_CRYPTO_CIPHER_AES_CBC
Definition: rte_crypto_sym.h:41
RTE_CRYPTO_AUTH_SNOW3G_UIA2
Definition: rte_crypto_sym.h:242
RTE_CRYPTO_CIPHER_AES_ECB
Definition: rte_crypto_sym.h:45
RTE_CRYPTO_AUTH_SHA384
Definition: rte_crypto_sym.h:233
rte_crypto_sym_op::data
uint8_t * data
Definition: rte_crypto_sym.h:520
rte_crypto_cipher_xform::offset
uint16_t offset
Definition: rte_crypto_sym.h:147
rte_crypto_cipher_operation
rte_crypto_cipher_operation
Definition: rte_crypto_sym.h:90
rte_crypto_cipher_xform::length
uint16_t length
Definition: rte_crypto_sym.h:118
RTE_CRYPTO_AUTH_AES_XCBC_MAC
Definition: rte_crypto_sym.h:210
rte_crypto_cipher_xform
Definition: rte_crypto_sym.h:107
rte_crypto_sym_op::sec_session
struct rte_security_session * sec_session
Definition: rte_crypto_sym.h:500
rte_crypto_aead_algorithm
rte_crypto_aead_algorithm
Definition: rte_crypto_sym.h:348
rte_common.h
RTE_CRYPTO_AUTH_SHA224
Definition: rte_crypto_sym.h:225
RTE_CRYPTO_CIPHER_AES_F8
Definition: rte_crypto_sym.h:47
RTE_CRYPTO_AUTH_MD5
Definition: rte_crypto_sym.h:216
rte_crypto_sym_xform::aead
struct rte_crypto_aead_xform aead
Definition: rte_crypto_sym.h:453
RTE_CRYPTO_AUTH_SHA256
Definition: rte_crypto_sym.h:229
rte_crypto_sym_xform
Definition: rte_crypto_sym.h:442
RTE_CRYPTO_AUTH_SHA1
Definition: rte_crypto_sym.h:221
rte_crypto_auth_xform::digest_length
uint16_t digest_length
Definition: rte_crypto_sym.h:334
rte_crypto_auth_xform
Definition: rte_crypto_sym.h:289
rte_crypto_auth_xform::iv
struct rte_crypto_auth_xform::@80 iv
RTE_CRYPTO_AUTH_SHA224_HMAC
Definition: rte_crypto_sym.h:227
RTE_CRYPTO_AUTH_NULL
Definition: rte_crypto_sym.h:201
RTE_STD_C11
#define RTE_STD_C11
Definition: rte_common.h:37
rte_crypto_sym_xform::type
enum rte_crypto_sym_xform_type type
Definition: rte_crypto_sym.h:445
RTE_CRYPTO_AUTH_MD5_HMAC
Definition: rte_crypto_sym.h:218
RTE_CRYPTO_AEAD_AES_GCM
Definition: rte_crypto_sym.h:351
RTE_CRYPTO_SYM_XFORM_AUTH
Definition: rte_crypto_sym.h:428
rte_cryptodev_sym_session
Definition: rte_cryptodev.h:956
rte_crypto_sym_xform_type
rte_crypto_sym_xform_type
Definition: rte_crypto_sym.h:426
rte_iova_t
uint64_t rte_iova_t
Definition: rte_memory.h:82
rte_mempool.h
rte_crypto_sym_op::data
struct rte_crypto_sym_op::@87::@89::@92 data
RTE_CRYPTO_SYM_XFORM_CIPHER
Definition: rte_crypto_sym.h:429
rte_crypto_sym_op::offset
uint32_t offset
Definition: rte_crypto_sym.h:508
rte_crypto_aead_operation
rte_crypto_aead_operation
Definition: rte_crypto_sym.h:361
rte_crypto_sym_op::session
struct rte_cryptodev_sym_session * session
Definition: rte_crypto_sym.h:496
rte_mbuf.h
RTE_CRYPTO_AUTH_SHA3_512_HMAC
Definition: rte_crypto_sym.h:262
RTE_CRYPTO_AEAD_OP_DECRYPT
Definition: rte_crypto_sym.h:364
RTE_CRYPTO_CIPHER_OP_ENCRYPT
Definition: rte_crypto_sym.h:91
rte_crypto_auth_algorithm
rte_crypto_auth_algorithm
Definition: rte_crypto_sym.h:200
RTE_CRYPTO_CIPHER_OP_DECRYPT
Definition: rte_crypto_sym.h:93
RTE_CRYPTO_CIPHER_3DES_CBC
Definition: rte_crypto_sym.h:34
RTE_CRYPTO_SYM_XFORM_AEAD
Definition: rte_crypto_sym.h:430
RTE_CRYPTO_CIPHER_AES_DOCSISBPI
Definition: rte_crypto_sym.h:67
rte_crypto_sym_xform::next
struct rte_crypto_sym_xform * next
Definition: rte_crypto_sym.h:443
rte_crypto_cipher_algorithm_strings
const char * rte_crypto_cipher_algorithm_strings[]
rte_crypto_auth_xform::algo
enum rte_crypto_auth_algorithm algo
Definition: rte_crypto_sym.h:292
rte_crypto_aead_algorithm_strings
const char * rte_crypto_aead_algorithm_strings[]
rte_crypto_sym_xform::cipher
struct rte_crypto_cipher_xform cipher
Definition: rte_crypto_sym.h:451
RTE_CRYPTO_AUTH_SHA3_384_HMAC
Definition: rte_crypto_sym.h:258
RTE_CRYPTO_CIPHER_SNOW3G_UEA2
Definition: rte_crypto_sym.h:58
rte_crypto_sym_op::digest
struct rte_crypto_sym_op::@87::@89::@93 digest
rte_crypto_auth_xform::data
uint8_t * data
Definition: rte_crypto_sym.h:296
RTE_CRYPTO_AUTH_SHA3_256
Definition: rte_crypto_sym.h:252
RTE_CRYPTO_AUTH_SHA3_256_HMAC
Definition: rte_crypto_sym.h:254
RTE_CRYPTO_AUTH_SHA384_HMAC
Definition: rte_crypto_sym.h:235
RTE_CRYPTO_AUTH_OP_GENERATE
Definition: rte_crypto_sym.h:275
rte_crypto_aead_operation_strings
const char * rte_crypto_aead_operation_strings[]
RTE_CRYPTO_AUTH_SHA256_HMAC
Definition: rte_crypto_sym.h:231
rte_crypto_sym_op
Definition: rte_crypto_sym.h:490
rte_crypto_sym_op::m_dst
struct rte_mbuf * m_dst
Definition: rte_crypto_sym.h:492
RTE_CRYPTO_AUTH_SHA3_512
Definition: rte_crypto_sym.h:260
rte_crypto_cipher_operation_strings
const char * rte_crypto_cipher_operation_strings[]
RTE_CRYPTO_AUTH_SHA3_224_HMAC
Definition: rte_crypto_sym.h:250
rte_crypto_auth_xform::offset
uint16_t offset
Definition: rte_crypto_sym.h:307