DPDK  22.11.7
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 
30 struct rte_cryptodev_asym_session;
31 
33 extern const char *
35 
37 extern const char *
39 
41 extern const char *
43 
44 #define RTE_CRYPTO_ASYM_FLAG_PUB_KEY_NO_PADDING RTE_BIT32(0)
45 
50 #define RTE_CRYPTO_ASYM_FLAG_SHARED_KEY_NO_PADDING RTE_BIT32(1)
51 
67  RTE_CRYPTO_EC_GROUP_SECP192R1 = 19,
68  RTE_CRYPTO_EC_GROUP_SECP224R1 = 21,
69  RTE_CRYPTO_EC_GROUP_SECP256R1 = 23,
70  RTE_CRYPTO_EC_GROUP_SECP384R1 = 24,
71  RTE_CRYPTO_EC_GROUP_SECP521R1 = 25
72 };
73 
123 };
124 
137  RTE_CRYPTO_ASYM_OP_LIST_END
138 };
139 
154 };
155 
170  RTE_CRYPTO_RSA_PADDING_TYPE_LIST_END
171 };
172 
187 };
188 
201 typedef struct rte_crypto_param_t {
202  uint8_t *data;
206  size_t length;
209 
212 
221 };
222 
238 };
239 
279  uint16_t pss_saltlen;
294 };
295 
308  enum rte_crypto_rsa_priv_key_type key_type;
309 
311  union {
316  };
317 };
318 
330 };
331 
341 };
342 
354 };
355 
371 };
372 
382 };
383 
394 };
395 
451 };
452 
487 };
488 
523 };
524 
556 };
557 
568  struct rte_crypto_ec_point q;
591 };
592 
597  struct rte_crypto_ec_point p;
600  struct rte_crypto_ec_point r;
605 };
606 
619  union {
620  struct rte_crypto_rsa_xform rsa;
629  struct rte_crypto_dh_xform dh;
632  struct rte_crypto_dsa_xform dsa;
635  struct rte_crypto_ec_xform ec;
639  };
640 };
641 
650  union {
651  struct rte_cryptodev_asym_session *session;
655  };
656 
658  union {
659  struct rte_crypto_rsa_op_param rsa;
660  struct rte_crypto_mod_op_param modex;
661  struct rte_crypto_mod_op_param modinv;
662  struct rte_crypto_dh_op_param dh;
663  struct rte_crypto_ecdh_op_param ecdh;
664  struct rte_crypto_dsa_op_param dsa;
665  struct rte_crypto_ecdsa_op_param ecdsa;
666  struct rte_crypto_ecpm_op_param ecpm;
667  };
668  uint16_t flags;
673 };
674 
675 #ifdef __cplusplus
676 }
677 #endif
678 
679 #endif /* _RTE_CRYPTO_ASYM_H_ */
rte_crypto_mod_op_param::base
rte_crypto_uint base
Definition: rte_crypto_asym.h:390
rte_crypto_rsa_priv_key_qt::p
rte_crypto_uint p
Definition: rte_crypto_asym.h:228
rte_crypto_ecdsa_op_param::k
rte_crypto_uint k
Definition: rte_crypto_asym.h:574
rte_crypto_rsa_priv_key_qt::dP
rte_crypto_uint dP
Definition: rte_crypto_asym.h:232
rte_crypto_rsa_xform::n
rte_crypto_uint n
Definition: rte_crypto_asym.h:303
rte_crypto_rsa_op_param::padding
struct rte_crypto_rsa_padding padding
Definition: rte_crypto_asym.h:449
rte_crypto_rsa_priv_key_type
rte_crypto_rsa_priv_key_type
Definition: rte_crypto_asym.h:180
rte_crypto_rsa_op_param::cipher
rte_crypto_param cipher
Definition: rte_crypto_asym.h:420
rte_crypto_ecdsa_op_param::pkey
rte_crypto_uint pkey
Definition: rte_crypto_asym.h:565
rte_crypto_ecpm_op_param::p
struct rte_crypto_ec_point p
Definition: rte_crypto_asym.h:597
rte_memory.h
rte_crypto_asym_op
Definition: rte_crypto_asym.h:648
rte_crypto_asym_xform::dh
struct rte_crypto_dh_xform dh
Definition: rte_crypto_asym.h:629
rte_crypto_rsa_priv_key_qt
Definition: rte_crypto_asym.h:227
rte_iova_t
uint64_t rte_iova_t
Definition: rte_common.h:458
rte_crypto_dsa_xform::g
rte_crypto_uint g
Definition: rte_crypto_asym.h:367
rte_crypto_ecpm_op_param::r
struct rte_crypto_ec_point r
Definition: rte_crypto_asym.h:600
rte_crypto_asym_xform::modex
struct rte_crypto_modex_xform modex
Definition: rte_crypto_asym.h:623
rte_crypto_dh_op_param
Definition: rte_crypto_asym.h:457
rte_crypto_rsa_xform
Definition: rte_crypto_asym.h:302
rte_crypto_asym_op::flags
uint16_t flags
Definition: rte_crypto_asym.h:668
RTE_CRYPTO_ASYM_XFORM_NONE
@ RTE_CRYPTO_ASYM_XFORM_NONE
Definition: rte_crypto_asym.h:83
rte_crypto_dsa_op_param::y
rte_crypto_uint y
Definition: rte_crypto_asym.h:552
rte_crypto_dh_op_param::priv_key
rte_crypto_uint priv_key
Definition: rte_crypto_asym.h:460
rte_crypto_ecdsa_op_param
Definition: rte_crypto_asym.h:561
RTE_CRYPTO_ASYM_XFORM_ECFPM
@ RTE_CRYPTO_ASYM_XFORM_ECFPM
Definition: rte_crypto_asym.h:119
rte_crypto_uint
rte_crypto_param rte_crypto_uint
Definition: rte_crypto_asym.h:211
rte_crypto_ecpm_op_param
Definition: rte_crypto_asym.h:596
rte_crypto_rsa_xform::qt
struct rte_crypto_rsa_priv_key_qt qt
Definition: rte_crypto_asym.h:314
rte_crypto_asym_xform::next
struct rte_crypto_asym_xform * next
Definition: rte_crypto_asym.h:613
rte_crypto_dsa_xform::q
rte_crypto_uint q
Definition: rte_crypto_asym.h:365
rte_crypto_rsa_padding::oaep_label
rte_crypto_param oaep_label
Definition: rte_crypto_asym.h:286
rte_crypto_rsa_padding::pss_saltlen
uint16_t pss_saltlen
Definition: rte_crypto_asym.h:279
rte_crypto_mod_op_param
Definition: rte_crypto_asym.h:389
rte_crypto_param_t
Definition: rte_crypto_asym.h:201
rte_crypto_rsa_op_param::message
rte_crypto_param message
Definition: rte_crypto_asym.h:404
rte_crypto_dsa_op_param::k
rte_crypto_uint k
Definition: rte_crypto_asym.h:534
rte_crypto_rsa_op_param::sign
rte_crypto_param sign
Definition: rte_crypto_asym.h:436
rte_crypto_asym_xform::modinv
struct rte_crypto_modinv_xform modinv
Definition: rte_crypto_asym.h:626
rte_crypto_dsa_xform
Definition: rte_crypto_asym.h:362
rte_crypto_dh_op_param::shared_secret
rte_crypto_uint shared_secret
Definition: rte_crypto_asym.h:482
rte_crypto_ecdh_op_param::ke_type
enum rte_crypto_asym_ke_type ke_type
Definition: rte_crypto_asym.h:493
rte_crypto_ecdh_op_param::priv_key
rte_crypto_uint priv_key
Definition: rte_crypto_asym.h:495
rte_crypto_rsa_priv_key_qt::dQ
rte_crypto_uint dQ
Definition: rte_crypto_asym.h:234
rte_crypto_ecdh_op_param::pub_key
struct rte_crypto_ec_point pub_key
Definition: rte_crypto_asym.h:509
rte_crypto_ecdh_op_param::shared_secret
struct rte_crypto_ec_point shared_secret
Definition: rte_crypto_asym.h:518
RTE_CRYPTO_ASYM_XFORM_ECPM
@ RTE_CRYPTO_ASYM_XFORM_ECPM
Definition: rte_crypto_asym.h:117
RTE_CRYPTO_ASYM_XFORM_RSA
@ RTE_CRYPTO_ASYM_XFORM_RSA
Definition: rte_crypto_asym.h:89
rte_crypto_ec_xform::curve_id
enum rte_crypto_curve_id curve_id
Definition: rte_crypto_asym.h:380
rte_crypto_asym_op_type
rte_crypto_asym_op_type
Definition: rte_crypto_asym.h:128
rte_crypto_asym_op::xform
struct rte_crypto_asym_xform * xform
Definition: rte_crypto_asym.h:653
rte_crypto_asym_xform_type
rte_crypto_asym_xform_type
Definition: rte_crypto_asym.h:80
rte_crypto_dh_xform
Definition: rte_crypto_asym.h:349
RTE_CRYPTO_RSA_PADDING_PKCS1_5
@ RTE_CRYPTO_RSA_PADDING_PKCS1_5
Definition: rte_crypto_asym.h:162
RTE_CRYPTO_ASYM_XFORM_MODINV
@ RTE_CRYPTO_ASYM_XFORM_MODINV
Definition: rte_crypto_asym.h:103
rte_crypto_ec_point
Definition: rte_crypto_asym.h:216
rte_crypto_ecdsa_op_param::s
rte_crypto_uint s
Definition: rte_crypto_asym.h:586
RTE_CRYPTO_RSA_PADDING_PSS
@ RTE_CRYPTO_RSA_PADDING_PSS
Definition: rte_crypto_asym.h:168
rte_crypto_dsa_op_param::s
rte_crypto_uint s
Definition: rte_crypto_asym.h:546
rte_crypto_rsa_padding
Definition: rte_crypto_asym.h:243
RTE_CRYPTO_RSA_PADDING_NONE
@ RTE_CRYPTO_RSA_PADDING_NONE
Definition: rte_crypto_asym.h:160
rte_crypto_ecdsa_op_param::q
struct rte_crypto_ec_point q
Definition: rte_crypto_asym.h:568
rte_crypto_modex_xform
Definition: rte_crypto_asym.h:325
RTE_CRYPTO_ASYM_OP_ENCRYPT
@ RTE_CRYPTO_ASYM_OP_ENCRYPT
Definition: rte_crypto_asym.h:129
rte_crypto_sym.h
rte_crypto_rsa_priv_key_qt::qInv
rte_crypto_uint qInv
Definition: rte_crypto_asym.h:236
RTE_RSA_KEY_TYPE_EXP
@ RTE_RSA_KEY_TYPE_EXP
Definition: rte_crypto_asym.h:181
rte_crypto_dsa_xform::x
rte_crypto_uint x
Definition: rte_crypto_asym.h:369
rte_crypto_modinv_xform::modulus
rte_crypto_uint modulus
Definition: rte_crypto_asym.h:339
rte_crypto_dsa_op_param::r
rte_crypto_uint r
Definition: rte_crypto_asym.h:540
rte_crypto_dh_op_param::pub_key
rte_crypto_uint pub_key
Definition: rte_crypto_asym.h:474
rte_crypto_asym_xform::dsa
struct rte_crypto_dsa_xform dsa
Definition: rte_crypto_asym.h:632
rte_crypto_dsa_xform::p
rte_crypto_uint p
Definition: rte_crypto_asym.h:363
RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY
@ RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY
Definition: rte_crypto_asym.h:150
rte_crypto_dsa_op_param
Definition: rte_crypto_asym.h:529
RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
@ RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
Definition: rte_crypto_asym.h:121
RTE_CRYPTO_ASYM_KE_PRIV_KEY_GENERATE
@ RTE_CRYPTO_ASYM_KE_PRIV_KEY_GENERATE
Definition: rte_crypto_asym.h:144
RTE_CRYPTO_RSA_PADDING_OAEP
@ RTE_CRYPTO_RSA_PADDING_OAEP
Definition: rte_crypto_asym.h:166
rte_common.h
rte_crypto_ecdsa_op_param::message
rte_crypto_param message
Definition: rte_crypto_asym.h:571
RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE
@ RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE
Definition: rte_crypto_asym.h:148
rte_crypto_asym_op_strings
const char * rte_crypto_asym_op_strings[]
rte_crypto_modex_xform::exponent
rte_crypto_uint exponent
Definition: rte_crypto_asym.h:328
RTE_CRYPTO_ASYM_XFORM_ECDSA
@ RTE_CRYPTO_ASYM_XFORM_ECDSA
Definition: rte_crypto_asym.h:111
rte_crypto_param_t::data
uint8_t * data
Definition: rte_crypto_asym.h:202
rte_crypto_dh_xform::p
rte_crypto_uint p
Definition: rte_crypto_asym.h:350
rte_crypto_rsa_op_param
Definition: rte_crypto_asym.h:400
RTE_CRYPTO_ASYM_XFORM_DSA
@ RTE_CRYPTO_ASYM_XFORM_DSA
Definition: rte_crypto_asym.h:98
rte_crypto_ec_xform
Definition: rte_crypto_asym.h:379
rte_crypto_dsa_op_param::op_type
enum rte_crypto_asym_op_type op_type
Definition: rte_crypto_asym.h:530
rte_crypto_asym_xform_strings
const char * rte_crypto_asym_xform_strings[]
RTE_STD_C11
#define RTE_STD_C11
Definition: rte_common.h:39
rte_crypto_modinv_xform
Definition: rte_crypto_asym.h:338
RTE_CRYPTO_ASYM_OP_DECRYPT
@ RTE_CRYPTO_ASYM_OP_DECRYPT
Definition: rte_crypto_asym.h:131
RTE_RSA_KEY_TYPE_QT
@ RTE_RSA_KEY_TYPE_QT
Definition: rte_crypto_asym.h:183
RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATE
@ RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATE
Definition: rte_crypto_asym.h:146
rte_crypto_rsa_priv_key_qt::q
rte_crypto_uint q
Definition: rte_crypto_asym.h:230
rte_mempool.h
rte_crypto_asym_xform::rsa
struct rte_crypto_rsa_xform rsa
Definition: rte_crypto_asym.h:620
rte_crypto_dh_xform::g
rte_crypto_uint g
Definition: rte_crypto_asym.h:352
rte_crypto_modex_xform::modulus
rte_crypto_uint modulus
Definition: rte_crypto_asym.h:326
rte_crypto_dh_op_param::ke_type
enum rte_crypto_asym_ke_type ke_type
Definition: rte_crypto_asym.h:458
RTE_CRYPTO_ASYM_XFORM_UNSPECIFIED
@ RTE_CRYPTO_ASYM_XFORM_UNSPECIFIED
Definition: rte_crypto_asym.h:81
rte_crypto_rsa_padding::mgf1hash
enum rte_crypto_auth_algorithm mgf1hash
Definition: rte_crypto_asym.h:271
RTE_CRYPTO_ASYM_XFORM_DH
@ RTE_CRYPTO_ASYM_XFORM_DH
Definition: rte_crypto_asym.h:93
rte_crypto_ecdsa_op_param::op_type
enum rte_crypto_asym_op_type op_type
Definition: rte_crypto_asym.h:562
rte_crypto_auth_algorithm
rte_crypto_auth_algorithm
Definition: rte_crypto_sym.h:309
rte_crypto_mod_op_param::result
rte_crypto_uint result
Definition: rte_crypto_asym.h:392
rte_crypto_param
struct rte_crypto_param_t rte_crypto_param
rte_crypto_rsa_xform::e
rte_crypto_uint e
Definition: rte_crypto_asym.h:305
RTE_CRYPTO_ASYM_XFORM_MODEX
@ RTE_CRYPTO_ASYM_XFORM_MODEX
Definition: rte_crypto_asym.h:107
rte_crypto_ecdsa_op_param::r
rte_crypto_uint r
Definition: rte_crypto_asym.h:581
RTE_CRYPTO_ASYM_OP_VERIFY
@ RTE_CRYPTO_ASYM_OP_VERIFY
Definition: rte_crypto_asym.h:135
rte_crypto_ecpm_op_param::scalar
rte_crypto_param scalar
Definition: rte_crypto_asym.h:603
RTE_CRYPTO_ASYM_XFORM_ECDH
@ RTE_CRYPTO_ASYM_XFORM_ECDH
Definition: rte_crypto_asym.h:115
rte_crypto_param_t::iova
rte_iova_t iova
Definition: rte_crypto_asym.h:204
rte_crypto_rsa_padding::type
enum rte_crypto_rsa_padding_type type
Definition: rte_crypto_asym.h:244
rte_crypto_ec_point::y
rte_crypto_param y
Definition: rte_crypto_asym.h:219
rte_crypto_rsa_padding_type
rte_crypto_rsa_padding_type
Definition: rte_crypto_asym.h:159
rte_crypto_rsa_padding::hash
enum rte_crypto_auth_algorithm hash
Definition: rte_crypto_asym.h:246
rte_crypto_asym_ke_strings
const char * rte_crypto_asym_ke_strings[]
RTE_CRYPTO_ASYM_OP_SIGN
@ RTE_CRYPTO_ASYM_OP_SIGN
Definition: rte_crypto_asym.h:133
rte_crypto_rsa_op_param::op_type
enum rte_crypto_asym_op_type op_type
Definition: rte_crypto_asym.h:401
rte_crypto_ecdh_op_param
Definition: rte_crypto_asym.h:492
rte_crypto_curve_id
rte_crypto_curve_id
Definition: rte_crypto_asym.h:66
rte_crypto_asym_op::session
struct rte_cryptodev_asym_session * session
Definition: rte_crypto_asym.h:651
rte_crypto_param_t::length
size_t length
Definition: rte_crypto_asym.h:206
rte_crypto_ec_point::x
rte_crypto_param x
Definition: rte_crypto_asym.h:217
rte_crypto_asym_xform::xform_type
enum rte_crypto_asym_xform_type xform_type
Definition: rte_crypto_asym.h:615
rte_crypto_asym_xform
Definition: rte_crypto_asym.h:612
rte_crypto_asym_xform::ec
struct rte_crypto_ec_xform ec
Definition: rte_crypto_asym.h:635
rte_crypto_asym_ke_type
rte_crypto_asym_ke_type
Definition: rte_crypto_asym.h:143
rte_crypto_rsa_xform::d
rte_crypto_uint d
Definition: rte_crypto_asym.h:312
rte_crypto_dsa_op_param::message
rte_crypto_param message
Definition: rte_crypto_asym.h:532