DPDK  20.11.0
rte_crypto_asym.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Cavium Networks
3  */
4 
5 #ifndef _RTE_CRYPTO_ASYM_H_
6 #define _RTE_CRYPTO_ASYM_H_
7 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #include <string.h>
22 #include <stdint.h>
23 
24 #include <rte_memory.h>
25 #include <rte_mempool.h>
26 #include <rte_common.h>
27 
28 #include "rte_crypto_sym.h"
29 
37 typedef struct rte_crypto_param_t {
38  uint8_t *data;
42  size_t length;
45 
47 extern const char *
49 
51 extern const char *
53 
99 };
100 
119  RTE_CRYPTO_ASYM_OP_LIST_END
120 };
121 
136  RTE_CRYPTO_RSA_PADDING_TYPE_LIST_END
137 };
138 
153 };
154 
197 };
198 
218  enum rte_crypto_rsa_priv_key_type key_type;
219 
220  __extension__
221  union {
231  };
232 };
233 
255 };
256 
276 };
277 
300 };
301 
332 };
333 
339  RTE_CRYPTO_EC_GROUP_UNKNOWN = 0,
340  RTE_CRYPTO_EC_GROUP_SECP192R1 = 19,
341  RTE_CRYPTO_EC_GROUP_SECP224R1 = 21,
342  RTE_CRYPTO_EC_GROUP_SECP256R1 = 23,
343  RTE_CRYPTO_EC_GROUP_SECP384R1 = 24,
344  RTE_CRYPTO_EC_GROUP_SECP521R1 = 25,
345 };
346 
355 };
356 
366 };
367 
393 };
394 
406  __extension__
407  union {
408  struct rte_crypto_rsa_xform rsa;
417  struct rte_crypto_dh_xform dh;
420  struct rte_crypto_dsa_xform dsa;
423  struct rte_crypto_ec_xform ec;
427  };
428 };
429 
431 
506 };
507 
539 };
540 
568 };
569 
580  struct rte_crypto_ec_point q;
601 };
602 
607  struct rte_crypto_ec_point p;
610  struct rte_crypto_ec_point r;
615 };
616 
625  union {
630  };
631 
632  __extension__
633  union {
634  struct rte_crypto_rsa_op_param rsa;
635  struct rte_crypto_mod_op_param modex;
636  struct rte_crypto_mod_op_param modinv;
637  struct rte_crypto_dh_op_param dh;
638  struct rte_crypto_dsa_op_param dsa;
639  struct rte_crypto_ecdsa_op_param ecdsa;
640  struct rte_crypto_ecpm_op_param ecpm;
641  };
642 };
643 
644 #ifdef __cplusplus
645 }
646 #endif
647 
648 #endif /* _RTE_CRYPTO_ASYM_H_ */
rte_crypto_rsa_xform::d
rte_crypto_param d
Definition: rte_crypto_asym.h:222
rte_crypto_modex_xform::modulus
rte_crypto_param modulus
Definition: rte_crypto_asym.h:241
rte_crypto_dsa_xform::g
rte_crypto_param g
Definition: rte_crypto_asym.h:320
rte_crypto_dh_op_param::shared_secret
rte_crypto_param shared_secret
Definition: rte_crypto_asym.h:532
rte_crypto_rsa_priv_key_type
rte_crypto_rsa_priv_key_type
Definition: rte_crypto_asym.h:146
rte_crypto_rsa_op_param::cipher
rte_crypto_param cipher
Definition: rte_crypto_asym.h:458
rte_crypto_ecpm_op_param::p
struct rte_crypto_ec_point p
Definition: rte_crypto_asym.h:607
rte_memory.h
rte_crypto_asym_op
Definition: rte_crypto_asym.h:623
rte_crypto_dh_op_param::pub_key
rte_crypto_param pub_key
Definition: rte_crypto_asym.h:513
rte_crypto_ecdsa_op_param::r
rte_crypto_param r
Definition: rte_crypto_asym.h:591
rte_crypto_rsa_priv_key_qt::qInv
rte_crypto_param qInv
Definition: rte_crypto_asym.h:190
rte_crypto_asym_xform::dh
struct rte_crypto_dh_xform dh
Definition: rte_crypto_asym.h:417
rte_crypto_rsa_priv_key_qt
Definition: rte_crypto_asym.h:159
rte_iova_t
uint64_t rte_iova_t
Definition: rte_common.h:418
rte_crypto_ecpm_op_param::r
struct rte_crypto_ec_point r
Definition: rte_crypto_asym.h:610
RTE_CRYPTO_ASYM_OP_PRIVATE_KEY_GENERATE
@ RTE_CRYPTO_ASYM_OP_PRIVATE_KEY_GENERATE
Definition: rte_crypto_asym.h:113
rte_crypto_dsa_xform::q
rte_crypto_param q
Definition: rte_crypto_asym.h:314
rte_crypto_asym_xform::modex
struct rte_crypto_modex_xform modex
Definition: rte_crypto_asym.h:411
rte_crypto_modex_xform::exponent
rte_crypto_param exponent
Definition: rte_crypto_asym.h:250
rte_crypto_dh_op_param
Definition: rte_crypto_asym.h:512
rte_crypto_rsa_xform
Definition: rte_crypto_asym.h:205
rte_crypto_dsa_xform::p
rte_crypto_param p
Definition: rte_crypto_asym.h:309
rte_crypto_rsa_priv_key_qt::dP
rte_crypto_param dP
Definition: rte_crypto_asym.h:174
RTE_CRYPTO_ASYM_XFORM_NONE
@ RTE_CRYPTO_ASYM_XFORM_NONE
Definition: rte_crypto_asym.h:63
RTE_CRYPTO_ASYM_OP_SHARED_SECRET_COMPUTE
@ RTE_CRYPTO_ASYM_OP_SHARED_SECRET_COMPUTE
Definition: rte_crypto_asym.h:117
rte_crypto_ecdsa_op_param
Definition: rte_crypto_asym.h:573
rte_crypto_ecpm_op_param
Definition: rte_crypto_asym.h:606
rte_crypto_rsa_xform::qt
struct rte_crypto_rsa_priv_key_qt qt
Definition: rte_crypto_asym.h:229
rte_crypto_asym_xform::next
struct rte_crypto_asym_xform * next
Definition: rte_crypto_asym.h:401
rte_crypto_modinv_xform::modulus
rte_crypto_param modulus
Definition: rte_crypto_asym.h:264
rte_crypto_rsa_priv_key_qt::dQ
rte_crypto_param dQ
Definition: rte_crypto_asym.h:182
rte_crypto_mod_op_param
Definition: rte_crypto_asym.h:373
rte_crypto_param_t
Definition: rte_crypto_asym.h:37
rte_crypto_rsa_op_param::message
rte_crypto_param message
Definition: rte_crypto_asym.h:440
rte_crypto_dsa_op_param::y
rte_crypto_param y
Definition: rte_crypto_asym.h:562
rte_crypto_rsa_op_param::sign
rte_crypto_param sign
Definition: rte_crypto_asym.h:473
rte_crypto_mod_op_param::base
rte_crypto_param base
Definition: rte_crypto_asym.h:374
rte_crypto_asym_xform::modinv
struct rte_crypto_modinv_xform modinv
Definition: rte_crypto_asym.h:414
rte_crypto_dsa_xform::x
rte_crypto_param x
Definition: rte_crypto_asym.h:324
rte_crypto_dh_xform::type
enum rte_crypto_asym_op_type type
Definition: rte_crypto_asym.h:285
rte_crypto_dsa_xform
Definition: rte_crypto_asym.h:308
RTE_CRYPTO_ASYM_XFORM_ECPM
@ RTE_CRYPTO_ASYM_XFORM_ECPM
Definition: rte_crypto_asym.h:95
RTE_CRYPTO_ASYM_XFORM_RSA
@ RTE_CRYPTO_ASYM_XFORM_RSA
Definition: rte_crypto_asym.h:69
rte_crypto_asym_op_type
rte_crypto_asym_op_type
Definition: rte_crypto_asym.h:104
rte_crypto_asym_op::xform
struct rte_crypto_asym_xform * xform
Definition: rte_crypto_asym.h:628
rte_crypto_asym_xform_type
rte_crypto_asym_xform_type
Definition: rte_crypto_asym.h:60
rte_crypto_dh_xform
Definition: rte_crypto_asym.h:284
RTE_CRYPTO_RSA_PADDING_PKCS1_5
@ RTE_CRYPTO_RSA_PADDING_PKCS1_5
Definition: rte_crypto_asym.h:128
RTE_CRYPTO_ASYM_XFORM_MODINV
@ RTE_CRYPTO_ASYM_XFORM_MODINV
Definition: rte_crypto_asym.h:83
rte_crypto_ec_point
Definition: rte_crypto_asym.h:350
rte_crypto_rsa_op_param::pad
enum rte_crypto_rsa_padding_type pad
Definition: rte_crypto_asym.h:488
rte_crypto_ecdsa_op_param::k
rte_crypto_param k
Definition: rte_crypto_asym.h:586
rte_crypto_ec_xform::curve_id
enum rte_crypto_ec_group curve_id
Definition: rte_crypto_asym.h:364
RTE_CRYPTO_RSA_PADDING_PSS
@ RTE_CRYPTO_RSA_PADDING_PSS
Definition: rte_crypto_asym.h:134
RTE_CRYPTO_RSA_PADDING_NONE
@ RTE_CRYPTO_RSA_PADDING_NONE
Definition: rte_crypto_asym.h:126
rte_crypto_ecdsa_op_param::q
struct rte_crypto_ec_point q
Definition: rte_crypto_asym.h:580
rte_crypto_modex_xform
Definition: rte_crypto_asym.h:240
RTE_CRYPTO_ASYM_OP_ENCRYPT
@ RTE_CRYPTO_ASYM_OP_ENCRYPT
Definition: rte_crypto_asym.h:105
rte_crypto_sym.h
RTE_RSA_KEY_TYPE_EXP
@ RTE_RSA_KEY_TYPE_EXP
Definition: rte_crypto_asym.h:147
rte_crypto_asym_xform::dsa
struct rte_crypto_dsa_xform dsa
Definition: rte_crypto_asym.h:420
rte_crypto_dsa_op_param
Definition: rte_crypto_asym.h:545
RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
@ RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
Definition: rte_crypto_asym.h:97
RTE_CRYPTO_RSA_PADDING_OAEP
@ RTE_CRYPTO_RSA_PADDING_OAEP
Definition: rte_crypto_asym.h:132
rte_common.h
rte_crypto_ecdsa_op_param::message
rte_crypto_param message
Definition: rte_crypto_asym.h:583
RTE_RSA_KET_TYPE_QT
@ RTE_RSA_KET_TYPE_QT
Definition: rte_crypto_asym.h:149
rte_crypto_ecdsa_op_param::s
rte_crypto_param s
Definition: rte_crypto_asym.h:596
rte_crypto_ecdsa_op_param::pkey
rte_crypto_param pkey
Definition: rte_crypto_asym.h:577
rte_crypto_asym_op_strings
const char * rte_crypto_asym_op_strings[]
RTE_CRYPTO_ASYM_OP_PUBLIC_KEY_GENERATE
@ RTE_CRYPTO_ASYM_OP_PUBLIC_KEY_GENERATE
Definition: rte_crypto_asym.h:115
RTE_CRYPTO_ASYM_XFORM_ECDSA
@ RTE_CRYPTO_ASYM_XFORM_ECDSA
Definition: rte_crypto_asym.h:91
rte_crypto_param_t::data
uint8_t * data
Definition: rte_crypto_asym.h:38
rte_crypto_rsa_op_param
Definition: rte_crypto_asym.h:436
rte_cryptodev_asym_session
Definition: rte_cryptodev.h:1017
rte_crypto_dsa_op_param::r
rte_crypto_param r
Definition: rte_crypto_asym.h:550
RTE_CRYPTO_ASYM_XFORM_DSA
@ RTE_CRYPTO_ASYM_XFORM_DSA
Definition: rte_crypto_asym.h:78
rte_crypto_ec_xform
Definition: rte_crypto_asym.h:363
rte_crypto_dsa_op_param::op_type
enum rte_crypto_asym_op_type op_type
Definition: rte_crypto_asym.h:546
rte_crypto_asym_xform_strings
const char * rte_crypto_asym_xform_strings[]
rte_crypto_rsa_priv_key_qt::q
rte_crypto_param q
Definition: rte_crypto_asym.h:167
RTE_STD_C11
#define RTE_STD_C11
Definition: rte_common.h:40
rte_crypto_modinv_xform
Definition: rte_crypto_asym.h:263
RTE_CRYPTO_ASYM_OP_DECRYPT
@ RTE_CRYPTO_ASYM_OP_DECRYPT
Definition: rte_crypto_asym.h:107
rte_crypto_ec_group
rte_crypto_ec_group
Definition: rte_crypto_asym.h:338
rte_mempool.h
rte_crypto_asym_xform::rsa
struct rte_crypto_rsa_xform rsa
Definition: rte_crypto_asym.h:408
rte_crypto_mod_op_param::result
rte_crypto_param result
Definition: rte_crypto_asym.h:384
rte_crypto_rsa_xform::e
rte_crypto_param e
Definition: rte_crypto_asym.h:212
RTE_CRYPTO_ASYM_XFORM_UNSPECIFIED
@ RTE_CRYPTO_ASYM_XFORM_UNSPECIFIED
Definition: rte_crypto_asym.h:61
rte_crypto_rsa_op_param::mgf1md
enum rte_crypto_auth_algorithm mgf1md
Definition: rte_crypto_asym.h:498
RTE_CRYPTO_ASYM_XFORM_DH
@ RTE_CRYPTO_ASYM_XFORM_DH
Definition: rte_crypto_asym.h:73
rte_crypto_ecdsa_op_param::op_type
enum rte_crypto_asym_op_type op_type
Definition: rte_crypto_asym.h:574
rte_crypto_auth_algorithm
rte_crypto_auth_algorithm
Definition: rte_crypto_sym.h:277
rte_crypto_param
struct rte_crypto_param_t rte_crypto_param
rte_crypto_rsa_xform::n
rte_crypto_param n
Definition: rte_crypto_asym.h:206
rte_crypto_dh_op_param::priv_key
rte_crypto_param priv_key
Definition: rte_crypto_asym.h:523
RTE_CRYPTO_ASYM_XFORM_MODEX
@ RTE_CRYPTO_ASYM_XFORM_MODEX
Definition: rte_crypto_asym.h:87
RTE_CRYPTO_ASYM_OP_VERIFY
@ RTE_CRYPTO_ASYM_OP_VERIFY
Definition: rte_crypto_asym.h:111
rte_crypto_dsa_op_param::s
rte_crypto_param s
Definition: rte_crypto_asym.h:556
rte_crypto_ecpm_op_param::scalar
rte_crypto_param scalar
Definition: rte_crypto_asym.h:613
rte_crypto_param_t::iova
rte_iova_t iova
Definition: rte_crypto_asym.h:40
rte_crypto_ec_point::y
rte_crypto_param y
Definition: rte_crypto_asym.h:353
rte_crypto_rsa_padding_type
rte_crypto_rsa_padding_type
Definition: rte_crypto_asym.h:125
RTE_CRYPTO_ASYM_OP_SIGN
@ RTE_CRYPTO_ASYM_OP_SIGN
Definition: rte_crypto_asym.h:109
rte_crypto_dh_xform::g
rte_crypto_param g
Definition: rte_crypto_asym.h:294
rte_crypto_rsa_op_param::op_type
enum rte_crypto_asym_op_type op_type
Definition: rte_crypto_asym.h:437
rte_crypto_rsa_op_param::md
enum rte_crypto_auth_algorithm md
Definition: rte_crypto_asym.h:491
rte_crypto_asym_op::session
struct rte_cryptodev_asym_session * session
Definition: rte_crypto_asym.h:626
rte_crypto_param_t::length
size_t length
Definition: rte_crypto_asym.h:42
rte_crypto_ec_point::x
rte_crypto_param x
Definition: rte_crypto_asym.h:351
rte_crypto_asym_xform::xform_type
enum rte_crypto_asym_xform_type xform_type
Definition: rte_crypto_asym.h:403
rte_crypto_asym_xform
Definition: rte_crypto_asym.h:400
rte_crypto_rsa_priv_key_qt::p
rte_crypto_param p
Definition: rte_crypto_asym.h:160
rte_crypto_dh_xform::p
rte_crypto_param p
Definition: rte_crypto_asym.h:288
rte_crypto_asym_xform::ec
struct rte_crypto_ec_xform ec
Definition: rte_crypto_asym.h:423
rte_crypto_dsa_op_param::message
rte_crypto_param message
Definition: rte_crypto_asym.h:548