• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is part of the openHiTLS project.
3  *
4  * openHiTLS is licensed under the Mulan PSL v2.
5  * You can use this software according to the terms and conditions of the Mulan PSL v2.
6  * You may obtain a copy of Mulan PSL v2 at:
7  *
8  *     http://license.coscl.org.cn/MulanPSL2
9  *
10  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13  * See the Mulan PSL v2 for more details.
14  */
15 
16 #ifndef CRYPT_PARAMS_KEY_H
17 #define CRYPT_PARAMS_KEY_H
18 
19 #include <stdint.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #define CRYPT_PARAM_PKEY_BASE                               0
26 #define CRYPT_PARAM_PKEY_ENCODE_PUBKEY                      (CRYPT_PARAM_PKEY_BASE + 1)
27 #define CRYPT_PARAM_PKEY_PROCESS_FUNC                       (CRYPT_PARAM_PKEY_BASE + 2)
28 #define CRYPT_PARAM_PKEY_PROCESS_ARGS                       (CRYPT_PARAM_PKEY_BASE + 3)
29 
30 #define CRYPT_PARAM_KDF_BASE                                100
31 #define CRYPT_PARAM_KDF_PASSWORD                            (CRYPT_PARAM_KDF_BASE + 1)
32 #define CRYPT_PARAM_KDF_MAC_ID                              (CRYPT_PARAM_KDF_BASE + 2)
33 #define CRYPT_PARAM_KDF_SALT                                (CRYPT_PARAM_KDF_BASE + 3)
34 #define CRYPT_PARAM_KDF_ITER                                (CRYPT_PARAM_KDF_BASE + 4)
35 #define CRYPT_PARAM_KDF_MODE                                (CRYPT_PARAM_KDF_BASE + 5)
36 #define CRYPT_PARAM_KDF_KEY                                 (CRYPT_PARAM_KDF_BASE + 6)
37 #define CRYPT_PARAM_KDF_PRK                                 (CRYPT_PARAM_KDF_BASE + 7)
38 #define CRYPT_PARAM_KDF_INFO                                (CRYPT_PARAM_KDF_BASE + 8)
39 #define CRYPT_PARAM_KDF_EXLEN                               (CRYPT_PARAM_KDF_BASE + 9)
40 #define CRYPT_PARAM_KDF_LABEL                               (CRYPT_PARAM_KDF_BASE + 11)
41 #define CRYPT_PARAM_KDF_SEED                                (CRYPT_PARAM_KDF_BASE + 12)
42 #define CRYPT_PARAM_KDF_N                                   (CRYPT_PARAM_KDF_BASE + 13)
43 #define CRYPT_PARAM_KDF_P                                   (CRYPT_PARAM_KDF_BASE + 14)
44 #define CRYPT_PARAM_KDF_R                                   (CRYPT_PARAM_KDF_BASE + 15)
45 
46 #define CRYPT_PARAM_EC_BASE                                 200
47 #define CRYPT_PARAM_EC_PUBKEY                               (CRYPT_PARAM_EC_BASE + 1)
48 #define CRYPT_PARAM_EC_PRVKEY                               (CRYPT_PARAM_EC_BASE + 2)
49 #define CRYPT_PARAM_EC_P                                    (CRYPT_PARAM_EC_BASE + 3)
50 #define CRYPT_PARAM_EC_A                                    (CRYPT_PARAM_EC_BASE + 4)
51 #define CRYPT_PARAM_EC_B                                    (CRYPT_PARAM_EC_BASE + 5)
52 #define CRYPT_PARAM_EC_N                                    (CRYPT_PARAM_EC_BASE + 6)
53 #define CRYPT_PARAM_EC_H                                    (CRYPT_PARAM_EC_BASE + 7)
54 #define CRYPT_PARAM_EC_X                                    (CRYPT_PARAM_EC_BASE + 8)
55 #define CRYPT_PARAM_EC_Y                                    (CRYPT_PARAM_EC_BASE + 9)
56 #define CRYPT_PARAM_EC_CURVE_ID                             (CRYPT_PARAM_EC_BASE + 10)
57 
58 #define CRYPT_PARAM_DH_BASE                                 300
59 #define CRYPT_PARAM_DH_PUBKEY                               (CRYPT_PARAM_DH_BASE + 1)
60 #define CRYPT_PARAM_DH_PRVKEY                               (CRYPT_PARAM_DH_BASE + 2)
61 #define CRYPT_PARAM_DH_P                                    (CRYPT_PARAM_DH_BASE + 3)
62 #define CRYPT_PARAM_DH_Q                                    (CRYPT_PARAM_DH_BASE + 4)
63 #define CRYPT_PARAM_DH_G                                    (CRYPT_PARAM_DH_BASE + 5)
64 
65 #define CRYPT_PARAM_DSA_BASE                                400
66 #define CRYPT_PARAM_DSA_PUBKEY                              (CRYPT_PARAM_DSA_BASE + 1)
67 #define CRYPT_PARAM_DSA_PRVKEY                              (CRYPT_PARAM_DSA_BASE + 2)
68 #define CRYPT_PARAM_DSA_P                                   (CRYPT_PARAM_DSA_BASE + 3)
69 #define CRYPT_PARAM_DSA_Q                                   (CRYPT_PARAM_DSA_BASE + 4)
70 #define CRYPT_PARAM_DSA_G                                   (CRYPT_PARAM_DSA_BASE + 5)
71 
72 #define CRYPT_PARAM_PAILLIER_BASE                           500
73 #define CRYPT_PARAM_PAILLIER_N                              (CRYPT_PARAM_PAILLIER_BASE + 1)
74 #define CRYPT_PARAM_PAILLIER_G                              (CRYPT_PARAM_PAILLIER_BASE + 2)
75 #define CRYPT_PARAM_PAILLIER_N2                             (CRYPT_PARAM_PAILLIER_BASE + 3)
76 #define CRYPT_PARAM_PAILLIER_LAMBDA                         (CRYPT_PARAM_PAILLIER_BASE + 4)
77 #define CRYPT_PARAM_PAILLIER_MU                             (CRYPT_PARAM_PAILLIER_BASE + 5)
78 #define CRYPT_PARAM_PAILLIER_P                              (CRYPT_PARAM_PAILLIER_BASE + 6)
79 #define CRYPT_PARAM_PAILLIER_Q                              (CRYPT_PARAM_PAILLIER_BASE + 7)
80 #define CRYPT_PARAM_PAILLIER_BITS                           (CRYPT_PARAM_PAILLIER_BASE + 8)
81 
82 #define CRYPT_PARAM_RAND_BASE                               600
83 #define CRYPT_PARAM_RAND_SEEDCTX                            (CRYPT_PARAM_RAND_BASE + 1)
84 #define CRYPT_PARAM_RAND_PR                                 (CRYPT_PARAM_RAND_BASE + 2)
85 #define CRYPT_PARAM_RAND_SEED_GETENTROPY                    (CRYPT_PARAM_RAND_BASE + 3)
86 #define CRYPT_PARAM_RAND_SEED_CLEANENTROPY                  (CRYPT_PARAM_RAND_BASE + 4)
87 #define CRYPT_PARAM_RAND_SEED_GETNONCE                      (CRYPT_PARAM_RAND_BASE + 5)
88 #define CRYPT_PARAM_RAND_SEED_CLEANNONCE                    (CRYPT_PARAM_RAND_BASE + 6)
89 
90 #define CRYPT_PARAM_CURVE25519_BASE                         700
91 #define CRYPT_PARAM_CURVE25519_PUBKEY                       (CRYPT_PARAM_CURVE25519_BASE + 1)
92 #define CRYPT_PARAM_CURVE25519_PRVKEY                       (CRYPT_PARAM_CURVE25519_BASE + 2)
93 
94 #define CRYPT_PARAM_ELGAMAL_BASE                            800
95 #define CRYPT_PARAM_ELGAMAL_P                               (CRYPT_PARAM_ELGAMAL_BASE + 1)
96 #define CRYPT_PARAM_ELGAMAL_G                               (CRYPT_PARAM_ELGAMAL_BASE + 2)
97 #define CRYPT_PARAM_ELGAMAL_X                               (CRYPT_PARAM_ELGAMAL_BASE + 3)
98 #define CRYPT_PARAM_ELGAMAL_Y                               (CRYPT_PARAM_ELGAMAL_BASE + 4)
99 #define CRYPT_PARAM_ELGAMAL_Q                               (CRYPT_PARAM_ELGAMAL_BASE + 5)
100 #define CRYPT_PARAM_ELGAMAL_BITS                            (CRYPT_PARAM_ELGAMAL_BASE + 6)
101 #define CRYPT_PARAM_ELGAMAL_KBITS                           (CRYPT_PARAM_ELGAMAL_BASE + 7)
102 
103 #define CRYPT_PARAM_RSA_BASE                                900
104 #define CRYPT_PARAM_RSA_N                                   (CRYPT_PARAM_RSA_BASE + 1)
105 #define CRYPT_PARAM_RSA_E                                   (CRYPT_PARAM_RSA_BASE + 2)
106 #define CRYPT_PARAM_RSA_D                                   (CRYPT_PARAM_RSA_BASE + 3)
107 #define CRYPT_PARAM_RSA_P                                   (CRYPT_PARAM_RSA_BASE + 4)
108 #define CRYPT_PARAM_RSA_Q                                   (CRYPT_PARAM_RSA_BASE + 5)
109 #define CRYPT_PARAM_RSA_DQ                                  (CRYPT_PARAM_RSA_BASE + 6)
110 #define CRYPT_PARAM_RSA_DP                                  (CRYPT_PARAM_RSA_BASE + 7)
111 #define CRYPT_PARAM_RSA_QINV                                (CRYPT_PARAM_RSA_BASE + 8)
112 #define CRYPT_PARAM_RSA_BITS                                (CRYPT_PARAM_RSA_BASE + 9)
113 #define CRYPT_PARAM_RSA_SALTLEN                             (CRYPT_PARAM_RSA_BASE + 10)
114 #define CRYPT_PARAM_RSA_MD_ID                               (CRYPT_PARAM_RSA_BASE + 11)
115 #define CRYPT_PARAM_RSA_MGF1_ID                             (CRYPT_PARAM_RSA_BASE + 12)
116 
117 #define CRYPT_PARAM_ML_KEM_BASE                             1400
118 #define CRYPT_PARAM_ML_KEM_PRVKEY                           (CRYPT_PARAM_ML_KEM_BASE + 1)
119 #define CRYPT_PARAM_ML_KEM_PUBKEY                           (CRYPT_PARAM_ML_KEM_BASE + 2)
120 
121 #define CRYPT_PARAM_ML_DSA_BASE                             1500
122 #define CRYPT_PARAM_ML_DSA_PRVKEY                           (CRYPT_PARAM_ML_DSA_BASE + 1)
123 #define CRYPT_PARAM_ML_DSA_PUBKEY                           (CRYPT_PARAM_ML_DSA_BASE + 2)
124 
125 #define CRYPT_PARAM_HYBRID_BASE                             1600
126 #define CRYPT_PARAM_HYBRID_PRVKEY                           (CRYPT_PARAM_HYBRID_BASE + 1)
127 #define CRYPT_PARAM_HYBRID_PUBKEY                           (CRYPT_PARAM_HYBRID_BASE + 2)
128 
129 #define CRYPT_PARAM_SLH_DSA_BASE                            1700
130 #define CRYPT_PARAM_SLH_DSA_PRV_SEED                        (CRYPT_PARAM_SLH_DSA_BASE + 1)
131 #define CRYPT_PARAM_SLH_DSA_PRV_PRF                         (CRYPT_PARAM_SLH_DSA_BASE + 2)
132 #define CRYPT_PARAM_SLH_DSA_PUB_SEED                        (CRYPT_PARAM_SLH_DSA_BASE + 3)
133 #define CRYPT_PARAM_SLH_DSA_PUB_ROOT                        (CRYPT_PARAM_SLH_DSA_BASE + 4)
134 
135 #define CRYPT_PARAM_DECODE_BASE                             4000
136 #define CRYPT_PARAM_DECODE_OUTPUT_FORMAT                    (CRYPT_PARAM_DECODE_BASE + 1)
137 #define CRYPT_PARAM_DECODE_OUTPUT_TYPE                      (CRYPT_PARAM_DECODE_BASE + 2)
138 #define CRYPT_PARAM_DECODE_PASSWORD                         (CRYPT_PARAM_DECODE_BASE + 3)
139 #define CRYPT_PARAM_DECODE_KEY_TYPE                         (CRYPT_PARAM_DECODE_BASE + 4)
140 #define CRYPT_PARAM_DECODE_BUFFER_DATA                      (CRYPT_PARAM_DECODE_BASE + 5)
141 #define CRYPT_PARAM_DECODE_OBJECT_DATA                      (CRYPT_PARAM_DECODE_BASE + 6)
142 #define CRYPT_PARAM_DECODE_OBJECT_TYPE                      (CRYPT_PARAM_DECODE_BASE + 7)
143 #define CRYPT_PARAM_DECODE_PKEY_EXPORT_METHOD_FUNC          (CRYPT_PARAM_DECODE_BASE + 8)
144 #define CRYPT_PARAM_DECODE_PKEY_DUP_METHOD_FUNC             (CRYPT_PARAM_DECODE_BASE + 9)
145 #define CRYPT_PARAM_DECODE_PKEY_FREE_METHOD_FUNC            (CRYPT_PARAM_DECODE_BASE + 10)
146 #define CRYPT_PARAM_DECODE_LIB_CTX                          (CRYPT_PARAM_DECODE_BASE + 11)
147 #define CRYPT_PARAM_DECODE_TARGET_ATTR_NAME                 (CRYPT_PARAM_DECODE_BASE + 12)
148 #define CRYPT_PARAM_DECODE_PROVIDER_CTX                     (CRYPT_PARAM_DECODE_BASE + 13)
149 #define CRYPT_PARAM_DECODE_FLAG_FREE_OUTDATA                (CRYPT_PARAM_DECODE_BASE + 14)
150 
151 #define CRYPT_PARAM_CAP_TLS_GROUP_BASE                      5000
152 #define CRYPT_PARAM_CAP_TLS_GROUP_IANA_GROUP_NAME           (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 1)
153 #define CRYPT_PARAM_CAP_TLS_GROUP_IANA_GROUP_ID             (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 2)
154 #define CRYPT_PARAM_CAP_TLS_GROUP_PARA_ID                   (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 3)
155 #define CRYPT_PARAM_CAP_TLS_GROUP_ALG_ID                    (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 4)
156 #define CRYPT_PARAM_CAP_TLS_GROUP_SEC_BITS                  (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 5)
157 #define CRYPT_PARAM_CAP_TLS_GROUP_VERSION_BITS              (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 6)
158 #define CRYPT_PARAM_CAP_TLS_GROUP_IS_KEM                    (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 7)
159 #define CRYPT_PARAM_CAP_TLS_GROUP_PUBKEY_LEN                (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 8)
160 #define CRYPT_PARAM_CAP_TLS_GROUP_SHAREDKEY_LEN             (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 9)
161 #define CRYPT_PARAM_CAP_TLS_GROUP_CIPHERTEXT_LEN            (CRYPT_PARAM_CAP_TLS_GROUP_BASE + 10)
162 
163 #define CRYPT_PARAM_CAP_TLS_SIGNALG_BASE                    5100
164 #define CRYPT_PARAM_CAP_TLS_SIGNALG_IANA_SIGN_NAME          (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 1)
165 #define CRYPT_PARAM_CAP_TLS_SIGNALG_IANA_SIGN_ID            (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 2)
166 #define CRYPT_PARAM_CAP_TLS_SIGNALG_KEY_TYPE                (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 3)
167 #define CRYPT_PARAM_CAP_TLS_SIGNALG_KEY_TYPE_OID            (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 4)
168 #define CRYPT_PARAM_CAP_TLS_SIGNALG_KEY_TYPE_NAME           (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 5)
169 #define CRYPT_PARAM_CAP_TLS_SIGNALG_PARA_ID                 (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 6)
170 #define CRYPT_PARAM_CAP_TLS_SIGNALG_PARA_OID                (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 7)
171 #define CRYPT_PARAM_CAP_TLS_SIGNALG_PARA_NAME               (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 8)
172 #define CRYPT_PARAM_CAP_TLS_SIGNALG_SIGNWITHMD_ID           (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 9)
173 #define CRYPT_PARAM_CAP_TLS_SIGNALG_SIGNWITHMD_OID          (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 10)
174 #define CRYPT_PARAM_CAP_TLS_SIGNALG_SIGNWITHMD_NAME         (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 11)
175 #define CRYPT_PARAM_CAP_TLS_SIGNALG_SIGN_ID                 (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 12)
176 #define CRYPT_PARAM_CAP_TLS_SIGNALG_MD_ID                   (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 13)
177 #define CRYPT_PARAM_CAP_TLS_SIGNALG_MD_OID                  (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 14)
178 #define CRYPT_PARAM_CAP_TLS_SIGNALG_MD_NAME                 (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 15)
179 #define CRYPT_PARAM_CAP_TLS_SIGNALG_SEC_BITS                (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 16)
180 #define CRYPT_PARAM_CAP_TLS_SIGNALG_CHAIN_VERSION_BITS      (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 17)
181 #define CRYPT_PARAM_CAP_TLS_SIGNALG_CERT_VERSION_BITS       (CRYPT_PARAM_CAP_TLS_SIGNALG_BASE + 18)
182 
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif
188