rte_crypto_asym.h(3)
β¨ rte_crypto_asym.h β¨ <span>β the rte_crypto_asym.h(3) glow-up</span>
okay bestie, grab a strawberry drink π because this is the asym crypto header of DPDK and it is a lot, but in the best way. it's in the Library Functions Manual, it's iconic, and we're gonna get through it together. no cap.
πΈ NAME πΈ
rte_crypto_asym.h
like... the file itself. that's the name. main character energy from the jump π
π¦ SYNOPSIS π¦
first you gotta pull in the crew:
#include <string.h>
#include <stdint.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_common.h>
#include 'rte_crypto_sym.h'
(and yes, that last one is written with single quotes in the original, so we keep it exactly like that, don't come for me π)
π Data Structures
here's the whole cast list, in order, and every single one of them matters:
struct rte_crypto_param_tstruct rte_crypto_ec_pointstruct rte_crypto_rsa_priv_key_qtstruct rte_crypto_rsa_paddingstruct rte_crypto_rsa_xformstruct rte_crypto_modex_xformstruct rte_crypto_modinv_xformstruct rte_crypto_dh_xformstruct rte_crypto_dsa_xformstruct rte_crypto_ec_xformstruct rte_crypto_mod_op_paramstruct rte_crypto_rsa_op_paramstruct rte_crypto_dh_op_paramstruct rte_crypto_ecdh_op_paramstruct rte_crypto_dsa_op_paramstruct rte_crypto_ecdsa_op_paramstruct rte_crypto_eddsa_op_paramstruct rte_crypto_ecpm_op_paramstruct rte_crypto_sm2_op_paramstruct rte_crypto_ml_kem_xformstruct rte_crypto_ml_kem_keygen_opstruct rte_crypto_ml_kem_keyver_opstruct rte_crypto_ml_kem_encap_opstruct rte_crypto_ml_kem_decap_opstruct rte_crypto_ml_kem_opstruct rte_crypto_ml_dsa_xformstruct rte_crypto_ml_dsa_keygen_opstruct rte_crypto_ml_dsa_siggen_opstruct rte_crypto_ml_dsa_sigver_opstruct rte_crypto_ml_dsa_opstruct rte_crypto_asym_xformstruct rte_crypto_asym_op
π Macros
tiny but mighty, and yes they are all RTE_BIT32 coded:
#define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_NO_PADDING RTE_BIT32(0)#define RTE_CRYPTO_ASYM_FLAG_SHARED_KEY_NO_PADDING RTE_BIT32(1)#define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_COMPRESSED RTE_BIT32(2)
π Typedefs
typedef struct rte_crypto_param_t rte_crypto_paramtypedef rte_crypto_param rte_crypto_uint
β Enumerations
so many enums, and each one is giving something:
enum rte_crypto_curve_idenum rte_crypto_edward_instanceenum rte_crypto_asym_xform_type { RTE_CRYPTO_ASYM_XFORM_UNSPECIFIED = 0, RTE_CRYPTO_ASYM_XFORM_NONE, RTE_CRYPTO_ASYM_XFORM_RSA, RTE_CRYPTO_ASYM_XFORM_DH, RTE_CRYPTO_ASYM_XFORM_DSA, RTE_CRYPTO_ASYM_XFORM_MODINV, RTE_CRYPTO_ASYM_XFORM_MODEX, RTE_CRYPTO_ASYM_XFORM_ECDSA, RTE_CRYPTO_ASYM_XFORM_ECDH, RTE_CRYPTO_ASYM_XFORM_ECPM, RTE_CRYPTO_ASYM_XFORM_ECFPM, RTE_CRYPTO_ASYM_XFORM_SM2, RTE_CRYPTO_ASYM_XFORM_EDDSA, RTE_CRYPTO_ASYM_XFORM_ML_KEM, RTE_CRYPTO_ASYM_XFORM_ML_DSA }enum rte_crypto_asym_op_type { RTE_CRYPTO_ASYM_OP_ENCRYPT, RTE_CRYPTO_ASYM_OP_DECRYPT, RTE_CRYPTO_ASYM_OP_SIGN, RTE_CRYPTO_ASYM_OP_VERIFY, RTE_CRYPTO_ASYM_OP_LIST_END }enum rte_crypto_asym_ke_type { RTE_CRYPTO_ASYM_KE_PRIV_KEY_GENERATE, RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATE, RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE, RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY }enum rte_crypto_rsa_padding_type { RTE_CRYPTO_RSA_PADDING_NONE = 0, RTE_CRYPTO_RSA_PADDING_PKCS1_5, RTE_CRYPTO_RSA_PADDING_OAEP, RTE_CRYPTO_RSA_PADDING_PSS }enum rte_crypto_rsa_priv_key_type { RTE_RSA_KEY_TYPE_EXP, RTE_RSA_KEY_TYPE_QT }enum rte_crypto_sm2_op_capa { RTE_CRYPTO_SM2_RNG, RTE_CRYPTO_SM2_PH, RTE_CRYPTO_SM2_PARTIAL }enum rte_crypto_ml_kem_typeenum rte_crypto_ml_kem_op_typeenum rte_crypto_ml_dsa_typeenum rte_crypto_ml_dsa_op_type
π§ Variables
const char * rte_crypto_asym_ke_strings []const char * rte_crypto_asym_op_strings []const uint16_t rte_crypto_ml_kem_pubkey_size []
π Detailed Description π
RTE Definitions for Asymmetric Cryptography
bestie, this is where it all lives. it defines the asymmetric algorithms and modes, plus all the supported asymmetric crypto operations. that's the whole vibe. π
Definition in file rte_crypto_asym.h.
π Macro Definition Documentation π
π #define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_NO_PADDING RTE_BIT32(0)
this flag says: bestie, hand me the public key without the leading zero bytes. if you don't set it, the public key gets padded on the left with zeros up to the size of the underlying algorithm β and that padded version? that's the default. π«Ά
Definition at line 58 of file rte_crypto_asym.h.
π #define RTE_CRYPTO_ASYM_FLAG_SHARED_KEY_NO_PADDING RTE_BIT32(1)
same energy, but for the shared secret: this flag means the shared secret comes back without leading zero bytes. leave it unset and the shared secret gets left-padded with zeros up to the size of the underlying algorithm β again, that's the default. β¨
Definition at line 64 of file rte_crypto_asym.h.
π #define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_COMPRESSED RTE_BIT32(2)
this one means the public key comes back in compressed form. iconique. π
Definition at line 70 of file rte_crypto_asym.h.
π¦ Typedef Documentation π¦
typedef struct rte_crypto_param_t rte_crypto_param
Buffer to hold crypto params required for asym operations.
okay so these buffers are versatile fr β they work both as input to the PMD and as output from the PMD. when you're using one for output from the PMD, you (the application, the one and only) have to make sure the buffer is big enough to hold the target data. no pressure or anything π
and here's the tea β: if an operation needs the PMD to generate a random number, and the device supports CSRNG, then 'data' should be set to NULL. that crypto parameter won't be used by the PMD at all, because it's getting generated internally. slay.
typedef rte_crypto_param rte_crypto_uint
Unsigned big-integer in big-endian format
Definition at line 255 of file rte_crypto_asym.h.
π Enumeration Type Documentation π
enum rte_crypto_curve_id
List of elliptic curves. this enum aligns with the TLS "Supported Groups" registry (which, iykyk, used to be called the NamedCurve registry). FFDH groups are not in this list, and β important β they will not be included in this list, ever. also, if a curve gets deprecated in TLS, that does not deprecate that curve in Cryptodev. two separate worlds, bestie. π
link, kept exactly as-is: https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml
Definition at line 84 of file rte_crypto_asym.h.
enum rte_crypto_edward_instance
List of Edwards curve instances as per RFC 8032 (Section 5).
Definition at line 98 of file rte_crypto_asym.h.
enum rte_crypto_asym_xform_type
Asymmetric crypto transformation types. each xform type maps to one asymmetric algorithm doing one specific operation. let's meet them all:
RTE_CRYPTO_ASYM_XFORM_UNSPECIFIEDβ Invalid xform. not it. πRTE_CRYPTO_ASYM_XFORM_NONEβ Xform type None. a PMD may support this to give you a passthrough op for debugging purposes. and ifxform_typeis none, thenop_typeis disregarded. periodt.RTE_CRYPTO_ASYM_XFORM_RSAβ RSA. does Encrypt, Decrypt, Sign and Verify. refer torte_crypto_asym_op_type.RTE_CRYPTO_ASYM_XFORM_DHβ Diffie-Hellman. does Key Generate and Shared Secret Compute. refer torte_crypto_asym_op_type.RTE_CRYPTO_ASYM_XFORM_DSAβ Digital Signature Algorithm. does Signature Generation and Verification. refer torte_crypto_asym_op_type.RTE_CRYPTO_ASYM_XFORM_MODINVβ Modular Multiplicative Inverse. performs Modular Multiplicative Inverseb^(-1) mod n. math ate. β¨RTE_CRYPTO_ASYM_XFORM_MODEXβ Modular Exponentiation. performs Modular Exponentiationb^e mod n.RTE_CRYPTO_ASYM_XFORM_ECDSAβ Elliptic Curve Digital Signature Algorithm. does Signature Generation and Verification.RTE_CRYPTO_ASYM_XFORM_ECDHβ Elliptic Curve Diffie Hellman.RTE_CRYPTO_ASYM_XFORM_ECPMβ Elliptic Curve Point Multiplication.RTE_CRYPTO_ASYM_XFORM_ECFPMβ Elliptic Curve Fixed Point Multiplication.RTE_CRYPTO_ASYM_XFORM_SM2β ShangMi 2. does Encrypt, Decrypt, Sign and Verify. refer torte_crypto_asym_op_type.RTE_CRYPTO_ASYM_XFORM_EDDSAβ Edwards Curve Digital Signature Algorithm. does Signature Generation and Verification.RTE_CRYPTO_ASYM_XFORM_ML_KEMβ Module Lattice based Key Encapsulation Mechanism. does Key Pair Generation, Encapsulation and Decapsulation.RTE_CRYPTO_ASYM_XFORM_ML_DSAβ Module Lattice based Digital Signature Algorithm. does Key Pair Generation, Signature Generation and Verification.
Definition at line 111 of file rte_crypto_asym.h.
enum rte_crypto_asym_op_type
Asymmetric crypto operation type variants. the menu of moves:
RTE_CRYPTO_ASYM_OP_ENCRYPTβ Asymmetric Encrypt operation.RTE_CRYPTO_ASYM_OP_DECRYPTβ Asymmetric Decrypt operation.RTE_CRYPTO_ASYM_OP_SIGNβ Signature Generation operation.RTE_CRYPTO_ASYM_OP_VERIFYβ Signature Verification operation.
Definition at line 174 of file rte_crypto_asym.h.
enum rte_crypto_asym_ke_type
Asymmetric crypto key exchange operation type. the key exchange lineup:
RTE_CRYPTO_ASYM_KE_PRIV_KEY_GENERATEβ Private Key generation operation.RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATEβ Public Key generation operation.RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTEβ Shared Secret compute operation.RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFYβ Public Key Verification β can be used for elliptic curve point validation. π
Definition at line 189 of file rte_crypto_asym.h.
enum rte_crypto_rsa_padding_type
Padding types for RSA signature. pick your padding:
RTE_CRYPTO_RSA_PADDING_NONEβ RSA no padding scheme.RTE_CRYPTO_RSA_PADDING_PKCS1_5β RSA PKCS#1 PKCS1-v1_5 padding scheme. for signatures, block type01is used; for encryption, block type02is used. both details, no skipping. πRTE_CRYPTO_RSA_PADDING_OAEPβ RSA PKCS#1 OAEP padding scheme.RTE_CRYPTO_RSA_PADDING_PSSβ RSA PKCS#1 PSS padding scheme.
Definition at line 205 of file rte_crypto_asym.h.
enum rte_crypto_rsa_priv_key_type
RSA private key type enumeration.
this enumerates the private key format you need to perform an RSA crypto transform. so basically, which key fit you're wearing today π
RTE_RSA_KEY_TYPE_EXPβ RSA private key is an exponent.RTE_RSA_KEY_TYPE_QTβ RSA private key is in quintuple format. seerte_crypto_rsa_priv_key_qt.
Definition at line 224 of file rte_crypto_asym.h.
enum rte_crypto_sm2_op_capa
SM2 operation capabilities. what this algorithm can actually do:
RTE_CRYPTO_SM2_RNGβ Random number generator supported in SM2 ops.RTE_CRYPTO_SM2_PHβ Prehash message before crypto op.RTE_CRYPTO_SM2_PARTIALβ Calculate elliptic curve points only.
Definition at line 674 of file rte_crypto_asym.h.
enum rte_crypto_ml_kem_type
PQC ML-KEM parameter type.
list of ML-KEM parameter types used in PQC. π₯
Definition at line 778 of file rte_crypto_asym.h.
enum rte_crypto_ml_kem_op_type
PQC ML-KEM op type.
list of ML-KEM op types in PQC.
Definition at line 790 of file rte_crypto_asym.h.
enum rte_crypto_ml_dsa_type
PQC ML-DSA parameter type.
list of ML-DSA parameter types used in PQC.
Definition at line 921 of file rte_crypto_asym.h.
enum rte_crypto_ml_dsa_op_type
PQC ML-DSA op type.
list of ML-DSA op types in PQC.
Definition at line 933 of file rte_crypto_asym.h.
π Variable Documentation π
const char* rte_crypto_asym_ke_strings[][extern] β asym key exchange operation type name strings. β¨const char* rte_crypto_asym_op_strings[][extern] β asym operations type name strings.const uint16_t rte_crypto_ml_kem_pubkey_size[][extern] β PQC ML crypto op parameters size. π
<!-- part 1 ends here, bestie β keep scrolling for part 2 π -->
π AUTHOR π
okay so plot twist bestie: nobody wrote this π this entire page was generated automatically by Doxygen for DPDK from the source code β like, the robot did it, the source code fed it, Doxygen spat it out, and here we are π«Ά so if something's slaying, thank the source code; if something's weird, that's between you and the generator π β¨
and that's a wrap on rte_crypto_asym.h(3) π this one came from DPDK, Version 25.11.3, bestie β go forth, do your asymmetric crypto, and remember the vibes are iconic but the math is serious πΈπ stay safe out there fr fr π¦
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms