rte_crypto_sym.h(3)
π rte_crypto_sym.h(3) π
okay bestie, welcome to the symmetric crypto header page β it's a DPDK one, section 3, and it's a whole meal. grab a snack π
β¨ NAME β¨
rte_crypto_sym.h β no cap, that's literally the whole name π
π¦ SYNOPSIS π¦
the includes, in this exact order, queen:
#include <string.h>
#include <rte_compat.h>
#include <rte_mbuf.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_common.h>
πΈ Data Structures πΈ
struct rte_crypto_vecstruct rte_crypto_sglstruct rte_crypto_va_iova_ptrstruct rte_crypto_sym_vecunion rte_crypto_sym_ofsstruct rte_crypto_cipher_xformstruct rte_crypto_auth_xformstruct rte_crypto_sym_xformstruct rte_crypto_sym_op
π Enumerations π
enum rte_crypto_cipher_algorithm β and yes, the = 1 on the first one is load-bearing, don't touch it:
{ RTE_CRYPTO_CIPHER_NULL = 1,
RTE_CRYPTO_CIPHER_3DES_CBC, RTE_CRYPTO_CIPHER_3DES_CTR,
RTE_CRYPTO_CIPHER_3DES_ECB, RTE_CRYPTO_CIPHER_AES_CBC,
RTE_CRYPTO_CIPHER_AES_CTR, RTE_CRYPTO_CIPHER_AES_ECB,
RTE_CRYPTO_CIPHER_AES_F8, RTE_CRYPTO_CIPHER_AES_XTS,
RTE_CRYPTO_CIPHER_ARC4, RTE_CRYPTO_CIPHER_KASUMI_F8,
RTE_CRYPTO_CIPHER_SNOW3G_UEA2, RTE_CRYPTO_CIPHER_ZUC_EEA3,
RTE_CRYPTO_CIPHER_DES_CBC, RTE_CRYPTO_CIPHER_AES_DOCSISBPI,
RTE_CRYPTO_CIPHER_DES_DOCSISBPI, RTE_CRYPTO_CIPHER_SM4_ECB,
RTE_CRYPTO_CIPHER_SM4_CBC, RTE_CRYPTO_CIPHER_SM4_CTR,
RTE_CRYPTO_CIPHER_SM4_OFB, RTE_CRYPTO_CIPHER_SM4_CFB,
RTE_CRYPTO_CIPHER_SM4_XTS }
enum rte_crypto_cipher_operation:
{ RTE_CRYPTO_CIPHER_OP_ENCRYPT,
RTE_CRYPTO_CIPHER_OP_DECRYPT }
enum rte_crypto_auth_algorithm β buckle up, it's long:
{ RTE_CRYPTO_AUTH_NULL = 1,
RTE_CRYPTO_AUTH_AES_CBC_MAC, RTE_CRYPTO_AUTH_AES_CMAC,
RTE_CRYPTO_AUTH_AES_GMAC, RTE_CRYPTO_AUTH_AES_XCBC_MAC,
RTE_CRYPTO_AUTH_KASUMI_F9, RTE_CRYPTO_AUTH_MD5,
RTE_CRYPTO_AUTH_MD5_HMAC, RTE_CRYPTO_AUTH_SHA1,
RTE_CRYPTO_AUTH_SHA1_HMAC, RTE_CRYPTO_AUTH_SHA224,
RTE_CRYPTO_AUTH_SHA224_HMAC, RTE_CRYPTO_AUTH_SHA256,
RTE_CRYPTO_AUTH_SHA256_HMAC, RTE_CRYPTO_AUTH_SHA384,
RTE_CRYPTO_AUTH_SHA384_HMAC, RTE_CRYPTO_AUTH_SHA512,
RTE_CRYPTO_AUTH_SHA512_HMAC, RTE_CRYPTO_AUTH_SNOW3G_UIA2,
RTE_CRYPTO_AUTH_ZUC_EIA3, RTE_CRYPTO_AUTH_SHA3_224,
RTE_CRYPTO_AUTH_SHA3_224_HMAC, RTE_CRYPTO_AUTH_SHA3_256,
RTE_CRYPTO_AUTH_SHA3_256_HMAC, RTE_CRYPTO_AUTH_SHA3_384,
RTE_CRYPTO_AUTH_SHA3_384_HMAC, RTE_CRYPTO_AUTH_SHA3_512,
RTE_CRYPTO_AUTH_SHA3_512_HMAC, RTE_CRYPTO_AUTH_SM3,
RTE_CRYPTO_AUTH_SHAKE_128, RTE_CRYPTO_AUTH_SHAKE_256,
RTE_CRYPTO_AUTH_SM3_HMAC }
enum rte_crypto_auth_operation:
{ RTE_CRYPTO_AUTH_OP_VERIFY,
RTE_CRYPTO_AUTH_OP_GENERATE }
enum rte_crypto_aead_algorithm:
{ RTE_CRYPTO_AEAD_AES_CCM = 1,
RTE_CRYPTO_AEAD_AES_GCM, RTE_CRYPTO_AEAD_CHACHA20_POLY1305,
RTE_CRYPTO_AEAD_SM4_GCM }
enum rte_crypto_aead_operation:
{ RTE_CRYPTO_AEAD_OP_ENCRYPT,
RTE_CRYPTO_AEAD_OP_DECRYPT }
enum rte_crypto_sym_xform_type:
{ RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED = 0,
RTE_CRYPTO_SYM_XFORM_AUTH, RTE_CRYPTO_SYM_XFORM_CIPHER,
RTE_CRYPTO_SYM_XFORM_AEAD }
π§ Functions π§
here they are, verbatim, because signatures are sacred:
static void __rte_crypto_sym_op_reset (struct rte_crypto_sym_op *op)
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)
static int __rte_crypto_sym_op_attach_sym_session (struct
rte_crypto_sym_op *sym_op, void *sess)
static __rte_experimental int rte_crypto_mbuf_to_vec (const struct
rte_mbuf *mb, uint32_t ofs, uint32_t len, struct rte_crypto_vec
vec[], uint32_t num)
heads up:rte_crypto_mbuf_to_vecis marked__rte_experimentalβ that's the experimental tag, so it can still change on you. don't build your whole personality on it π
β Variables β
const char * rte_crypto_cipher_operation_strings []const char * rte_crypto_auth_operation_strings []const char * rte_crypto_aead_operation_strings []
π Detailed Description π
RTE Definitions for Symmetric Cryptography β say it with me π
This header defines symmetric cipher and authentication algorithms and modes, as well as supported symmetric crypto operation combinations. it's giving "the whole toolbox" energy fr fr.
Definition in file rte_crypto_sym.h.
π Enumeration Type Documentation π
π
enum rte_crypto_cipher_algorithm π
Symmetric Cipher Algorithms.
okay so before you touch anything, note this β to avoid ABI breakage across releases:
LIST_ENDshould not be added to this enum- the order of enums should not be changed
- new algorithms should only be added to the end
like, the order is the vibe. respect the order. periodt.
Enumerator
RTE_CRYPTO_CIPHER_NULLβ NULL cipher algorithm. no mode applies to the NULL algorithm, she's built different.RTE_CRYPTO_CIPHER_3DES_CBCβ Triple DES algorithm in CBC modeRTE_CRYPTO_CIPHER_3DES_CTRβ Triple DES algorithm in CTR modeRTE_CRYPTO_CIPHER_3DES_ECBβ Triple DES algorithm in ECB modeRTE_CRYPTO_CIPHER_AES_CBCβ AES algorithm in CBC modeRTE_CRYPTO_CIPHER_AES_CTRβ AES algorithm in Counter modeRTE_CRYPTO_CIPHER_AES_ECBβ AES algorithm in ECB modeRTE_CRYPTO_CIPHER_AES_F8β AES algorithm in F8 modeRTE_CRYPTO_CIPHER_AES_XTSβ AES algorithm in XTS modeRTE_CRYPTO_CIPHER_ARC4β (A)RC4 cipher algorithmRTE_CRYPTO_CIPHER_KASUMI_F8β KASUMI algorithm in F8 modeRTE_CRYPTO_CIPHER_SNOW3G_UEA2β SNOW 3G algorithm in UEA2 modeRTE_CRYPTO_CIPHER_ZUC_EEA3β ZUC algorithm in EEA3 modeRTE_CRYPTO_CIPHER_DES_CBCβ DES algorithm in CBC modeRTE_CRYPTO_CIPHER_AES_DOCSISBPIβ AES algorithm using modes required by DOCSIS Baseline Privacy Plus Spec. β οΈ chained mbufs are not supported in this mode, i.e.rte_mbuf.nextform_srcandm_dstin therte_crypto_sym_opmust beNULL. like, actuallyNULL. don't test her.RTE_CRYPTO_CIPHER_DES_DOCSISBPIβ DES algorithm using modes required by DOCSIS Baseline Privacy Plus Spec. β οΈ same deal, chained mbufs are not supported in this mode, i.e.rte_mbuf.nextform_srcandm_dstin therte_crypto_sym_opmust beNULL.RTE_CRYPTO_CIPHER_SM4_ECBβ ShangMi 4 (SM4) algorithm in ECB modeRTE_CRYPTO_CIPHER_SM4_CBCβ ShangMi 4 (SM4) algorithm in CBC modeRTE_CRYPTO_CIPHER_SM4_CTRβ ShangMi 4 (SM4) algorithm in CTR modeRTE_CRYPTO_CIPHER_SM4_OFBβ ShangMi 4 (SM4) algorithm in OFB modeRTE_CRYPTO_CIPHER_SM4_CFBβ ShangMi 4 (SM4) algorithm in CFB modeRTE_CRYPTO_CIPHER_SM4_XTSβ ShangMi 4 (SM4) algorithm in XTS mode
Definition at line 120 of file rte_crypto_sym.h.
π«Ά enum rte_crypto_cipher_operation π«Ά
Symmetric Cipher Direction β which way are we going, bestie?
Enumerator
RTE_CRYPTO_CIPHER_OP_ENCRYPTβ Encrypt cipher operationRTE_CRYPTO_CIPHER_OP_DECRYPTβ Decrypt cipher operation
Definition at line 186 of file rte_crypto_sym.h.
π enum rte_crypto_auth_algorithm π
Symmetric Authentication / Hash Algorithms.
and again, to avoid ABI breakage across releases:
LIST_ENDshould not be added to this enum- the order of enums should not be changed
- new algorithms should only be added to the end
Enumerator
RTE_CRYPTO_AUTH_NULLβ NULL hash algorithm.RTE_CRYPTO_AUTH_AES_CBC_MACβ AES-CBC-MAC algorithm. only 128-bit keys are supported β so no, your 256-bit key is not invited to this one πRTE_CRYPTO_AUTH_AES_CMACβ AES CMAC algorithm.RTE_CRYPTO_AUTH_AES_GMACβ AES GMAC algorithm.RTE_CRYPTO_AUTH_AES_XCBC_MACβ AES XCBC algorithm.RTE_CRYPTO_AUTH_KASUMI_F9β KASUMI algorithm in F9 mode.RTE_CRYPTO_AUTH_MD5β MD5 algorithmRTE_CRYPTO_AUTH_MD5_HMACβ HMAC using MD5 algorithmRTE_CRYPTO_AUTH_SHA1β 160 bit SHA algorithm.RTE_CRYPTO_AUTH_SHA1_HMACβ HMAC using 160 bit SHA algorithm. π HMAC-SHA-1-96 can be generated by settingdigest_lengthto 12 bytes in auth/aead xforms.RTE_CRYPTO_AUTH_SHA224β 224 bit SHA algorithm.RTE_CRYPTO_AUTH_SHA224_HMACβ HMAC using 224 bit SHA algorithm.RTE_CRYPTO_AUTH_SHA256β 256 bit SHA algorithm.RTE_CRYPTO_AUTH_SHA256_HMACβ HMAC using 256 bit SHA algorithm.RTE_CRYPTO_AUTH_SHA384β 384 bit SHA algorithm.RTE_CRYPTO_AUTH_SHA384_HMACβ HMAC using 384 bit SHA algorithm.RTE_CRYPTO_AUTH_SHA512β 512 bit SHA algorithm.RTE_CRYPTO_AUTH_SHA512_HMACβ HMAC using 512 bit SHA algorithm.RTE_CRYPTO_AUTH_SNOW3G_UIA2β SNOW 3G algorithm in UIA2 mode.RTE_CRYPTO_AUTH_ZUC_EIA3β ZUC algorithm in EIA3 modeRTE_CRYPTO_AUTH_SHA3_224β 224 bit SHA3 algorithm.RTE_CRYPTO_AUTH_SHA3_224_HMACβ HMAC using 224 bit SHA3 algorithm.RTE_CRYPTO_AUTH_SHA3_256β 256 bit SHA3 algorithm.RTE_CRYPTO_AUTH_SHA3_256_HMACβ HMAC using 256 bit SHA3 algorithm.RTE_CRYPTO_AUTH_SHA3_384β 384 bit SHA3 algorithm.RTE_CRYPTO_AUTH_SHA3_384_HMACβ HMAC using 384 bit SHA3 algorithm.RTE_CRYPTO_AUTH_SHA3_512β 512 bit SHA3 algorithm.RTE_CRYPTO_AUTH_SHA3_512_HMACβ HMAC using 512 bit SHA3 algorithm.RTE_CRYPTO_AUTH_SM3β ShangMi 3 (SM3) algorithmRTE_CRYPTO_AUTH_SHAKE_128β 128 bit SHAKE algorithm.RTE_CRYPTO_AUTH_SHAKE_256β 256 bit SHAKE algorithm.
Definition at line 311 of file rte_crypto_sym.h.
π¦ enum rte_crypto_auth_operation π¦
Symmetric Authentication / Hash Operations.
Enumerator
RTE_CRYPTO_AUTH_OP_VERIFYβ Verify authentication digestRTE_CRYPTO_AUTH_OP_GENERATEβ Generate authentication digest
Definition at line 390 of file rte_crypto_sym.h.
π₯ enum rte_crypto_aead_algorithm π₯
Symmetric AEAD Algorithms.
once more with feeling, to avoid ABI breakage across releases:
LIST_ENDshould not be added to this enum- the order of enums should not be changed
- new algorithms should only be added to the end
Enumerator
RTE_CRYPTO_AEAD_AES_CCMβ AES algorithm in CCM mode.RTE_CRYPTO_AEAD_AES_GCMβ AES algorithm in GCM mode.RTE_CRYPTO_AEAD_CHACHA20_POLY1305β Chacha20 cipher with poly1305 authenticatorRTE_CRYPTO_AEAD_SM4_GCMβ SM4 cipher in GCM mode
Definition at line 480 of file rte_crypto_sym.h.
πΈ enum rte_crypto_aead_operation πΈ
Symmetric AEAD Operations.
Enumerator
RTE_CRYPTO_AEAD_OP_ENCRYPTβ Encrypt and generate digestRTE_CRYPTO_AEAD_OP_DECRYPTβ Verify digest and decrypt
Definition at line 492 of file rte_crypto_sym.h.
π enum rte_crypto_sym_xform_type π
Crypto transformation types β the "what kind of xform am I even looking at" enum.
Enumerator
RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIEDβ No xform specifiedRTE_CRYPTO_SYM_XFORM_AUTHβ Authentication xformRTE_CRYPTO_SYM_XFORM_CIPHERβ Cipher xformRTE_CRYPTO_SYM_XFORM_AEADβ AEAD xform
Definition at line 564 of file rte_crypto_sym.h.
to be continued bestie π part 2 is coming and it's not done with us yet π§β¨
π FUNCTION DOCUMENTATION π
okay bestie, this is the part where the actual functions live β small helpers, all static + inline, all defined right there in the header. no cap, these are the little glue gidgets that make a symmetric crypto op behave. let's go one by one π«Ά
π§Ό __rte_crypto_sym_op_reset
static void __rte_crypto_sym_op_reset (struct rte_crypto_sym_op * op)
[inline], [static]
Reset the fields of a symmetric operation to their default values. that's it, that's the job β a clean slate for your op, no leftover vibes from whatever it was doing before β¨
Parameters
opβ the crypto operation to be reset.
Definition at line 887 of file rte_crypto_sym.h.
π§ __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)
[inline], [static]
Allocate space for symmetric crypto xforms in the private data space of the crypto operation. and because it's an overachiever, it also defaults the crypto xform type to RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED and configures the chaining of the xforms in the crypto operation. one call, three jobs, main character energy fr π₯
Returns
- On success, returns a pointer to the first crypto xform in the crypto operation's chain π
- On failure, returns
NULLπ
Definition at line 904 of file rte_crypto_sym.h.
π __rte_crypto_sym_op_attach_sym_session
static int __rte_crypto_sym_op_attach_sym_session (struct rte_crypto_sym_op
* sym_op, void * sess)
[inline], [static]
Attach a session to a symmetric crypto operation. yes bestie, this is the "you two belong together" function π
Parameters
sym_opβ crypto operationsessβ cryptodev session
Definition at line 927 of file rte_crypto_sym.h.
π¦ rte_crypto_mbuf_to_vec
static __rte_experimental int rte_crypto_mbuf_to_vec (const struct rte_mbuf
* mb, uint32_t ofs, uint32_t len, struct rte_crypto_vec vec[], uint32_t
num)
[inline], [static]
Converts a portion of mbuf data into a vector representation. each segment gets its own separate entry in the vec array β one segment, one lil' slot, no cramming πΈ
β οΈ heads up: this function expects that the providedofs+lendoes not exceed the mbuf'spkt_len. it's not gonna check your math for you, so pls do check it π
Parameters
mbβ pointer to therte_mbufobject.ofsβ offset within the mbuf data to start with.lenβ length of data to represent.vecβ pointer to an output array of IO vectors.numβ size of the output array.
Returns
- the number of successfully filled entries in the
vecarray β - a negative number of elements in the
vecarray required π (so like, it can tell you how much room it actually needed)
Definition at line 954 of file rte_crypto_sym.h.
π VARIABLE DOCUMENTATION π
just three little extern string arrays, chilling. they're name strings for the operations β handy for printing stuff in a human-readable way, iykyk π
const char* rte_crypto_cipher_operation_strings[][extern] β cipher operation name strings πconst char* rte_crypto_auth_operation_strings[][extern] β authentication operation name strings βconst char* rte_crypto_aead_operation_strings[][extern] β authentication operation name strings π (yes, it says authentication again β that's literally what the page says, not me being chaotic, I promise π«Ά)
π AUTHOR π
Generated automatically by Doxygen for DPDK from the source code. so no human author to thank here β the robots did this one, and honestly? they ate π€β¨
and that's a wrap on part 2, bestie!! π this page came straight out of the DPDK source code, version 25.11.0, dated Fri Jan 30 2026 β go forth and sym-op responsibly πππ¦
π¦ where this page comes from
- centos-stream 9: dpdk-devel 2:25.11-1.el9 Β· BSD and LGPLv2 and GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms