rte_crypto_asym.h(3)

πŸ“¦
version 25.11.3 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ 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_t
  • struct rte_crypto_ec_point
  • struct rte_crypto_rsa_priv_key_qt
  • struct rte_crypto_rsa_padding
  • struct rte_crypto_rsa_xform
  • struct rte_crypto_modex_xform
  • struct rte_crypto_modinv_xform
  • struct rte_crypto_dh_xform
  • struct rte_crypto_dsa_xform
  • struct rte_crypto_ec_xform
  • struct rte_crypto_mod_op_param
  • struct rte_crypto_rsa_op_param
  • struct rte_crypto_dh_op_param
  • struct rte_crypto_ecdh_op_param
  • struct rte_crypto_dsa_op_param
  • struct rte_crypto_ecdsa_op_param
  • struct rte_crypto_eddsa_op_param
  • struct rte_crypto_ecpm_op_param
  • struct rte_crypto_sm2_op_param
  • struct rte_crypto_ml_kem_xform
  • struct rte_crypto_ml_kem_keygen_op
  • struct rte_crypto_ml_kem_keyver_op
  • struct rte_crypto_ml_kem_encap_op
  • struct rte_crypto_ml_kem_decap_op
  • struct rte_crypto_ml_kem_op
  • struct rte_crypto_ml_dsa_xform
  • struct rte_crypto_ml_dsa_keygen_op
  • struct rte_crypto_ml_dsa_siggen_op
  • struct rte_crypto_ml_dsa_sigver_op
  • struct rte_crypto_ml_dsa_op
  • struct rte_crypto_asym_xform
  • struct 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_param
  • typedef rte_crypto_param rte_crypto_uint

⭐ Enumerations

so many enums, and each one is giving something:

  • enum rte_crypto_curve_id
  • enum rte_crypto_edward_instance
  • enum 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_type
  • enum rte_crypto_ml_kem_op_type
  • enum rte_crypto_ml_dsa_type
  • enum 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 if xform_type is none, then op_type is disregarded. periodt.
  • RTE_CRYPTO_ASYM_XFORM_RSA β€” RSA. does Encrypt, Decrypt, Sign and Verify. refer to rte_crypto_asym_op_type.
  • RTE_CRYPTO_ASYM_XFORM_DH β€” Diffie-Hellman. does Key Generate and Shared Secret Compute. refer to rte_crypto_asym_op_type.
  • RTE_CRYPTO_ASYM_XFORM_DSA β€” Digital Signature Algorithm. does Signature Generation and Verification. refer to rte_crypto_asym_op_type.
  • RTE_CRYPTO_ASYM_XFORM_MODINV β€” Modular Multiplicative Inverse. performs Modular Multiplicative Inverse b^(-1) mod n. math ate. ✨
  • RTE_CRYPTO_ASYM_XFORM_MODEX β€” Modular Exponentiation. performs Modular Exponentiation b^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 to rte_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 type 01 is used; for encryption, block type 02 is 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. see rte_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