Update core_names.h fields and document most fields.
[openssl.git] / include / openssl / core_names.h
1 /*
2  * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License 2.0 (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #ifndef OPENSSL_CORE_NAMES_H
11 # define OPENSSL_CORE_NAMES_H
12
13 # ifdef __cplusplus
14 extern "C" {
15 # endif
16
17 /* Well known parameter names that core passes to providers */
18 #define OSSL_PROV_PARAM_CORE_VERSION         "openssl-version" /* utf8_ptr */
19 #define OSSL_PROV_PARAM_CORE_PROV_NAME       "provider-name"   /* utf8_ptr */
20 #define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename" /* utf8_ptr */
21
22 /* Well known parameter names that Providers can define */
23 #define OSSL_PROV_PARAM_NAME            "name"                /* utf8_string */
24 #define OSSL_PROV_PARAM_VERSION         "version"             /* utf8_string */
25 #define OSSL_PROV_PARAM_BUILDINFO       "buildinfo"           /* utf8_string */
26
27 /* Self test callback parameters */
28 #define OSSL_PROV_PARAM_SELF_TEST_PHASE  "st-phase" /* utf8_string */
29 #define OSSL_PROV_PARAM_SELF_TEST_TYPE   "st-type"  /* utf8_string */
30 #define OSSL_PROV_PARAM_SELF_TEST_DESC   "st-desc"  /* utf8_string */
31
32 /*
33  * Algorithm parameters
34  * If "engine" or "properties" are specified, they should always be paired
35  * with the algorithm type.
36  * Note these are common names that are shared by many types (such as kdf, mac,
37  * and pkey) e.g: see OSSL_MAC_PARAM_DIGEST below.
38  */
39 #define OSSL_ALG_PARAM_DIGEST       "digest"    /* utf8_string */
40 #define OSSL_ALG_PARAM_CIPHER       "cipher"    /* utf8_string */
41 #define OSSL_ALG_PARAM_MAC          "mac"       /* utf8_string */
42 #define OSSL_ALG_PARAM_PROPERTIES   "properties"/* utf8_string */
43
44 /* cipher parameters */
45 #define OSSL_CIPHER_PARAM_PADDING              "padding"    /* uint */
46 #define OSSL_CIPHER_PARAM_MODE                 "mode"       /* uint */
47 #define OSSL_CIPHER_PARAM_BLOCK_SIZE           "blocksize" /* size_t */
48 #define OSSL_CIPHER_PARAM_FLAGS                "flags"      /* ulong */
49 #define OSSL_CIPHER_PARAM_KEYLEN               "keylen"     /* size_t */
50 #define OSSL_CIPHER_PARAM_IVLEN                "ivlen"      /* size_t */
51 #define OSSL_CIPHER_PARAM_IV                   "iv"         /* octet_string OR octet_ptr */
52 #define OSSL_CIPHER_PARAM_NUM                  "num"        /* uint */
53 #define OSSL_CIPHER_PARAM_ROUNDS               "rounds"     /* uint */
54 #define OSSL_CIPHER_PARAM_AEAD_TAG             "tag"        /* octet_string */
55 #define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD        "tlsaad"     /* octet_string */
56 #define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD    "tlsaadpad"  /* size_t */
57 #define OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED   "tlsivfixed" /* octet_string */
58 #define OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN "tlsivgen" /* octet_string */
59 #define OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV "tlsivinv" /* octet_string */
60 #define OSSL_CIPHER_PARAM_AEAD_IVLEN           OSSL_CIPHER_PARAM_IVLEN
61 #define OSSL_CIPHER_PARAM_AEAD_TAGLEN          "taglen"     /* size_t */
62 #define OSSL_CIPHER_PARAM_AEAD_MAC_KEY         "mackey"     /* octet_string */
63 #define OSSL_CIPHER_PARAM_RANDOM_KEY           "randkey"    /* octet_string */
64 #define OSSL_CIPHER_PARAM_RC2_KEYBITS          "keybits"    /* size_t */
65 #define OSSL_CIPHER_PARAM_SPEED                "speed"      /* uint */
66 /* For passing the AlgorithmIdentifier parameter in DER form */
67 #define OSSL_CIPHER_PARAM_ALG_ID               "alg_id_param" /* octet_string */
68
69 #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT                    \
70     "tls1multi_maxsndfrag" /* uint */
71 #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE                          \
72     "tls1multi_maxbufsz"   /* size_t */
73 #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE                           \
74     "tls1multi_interleave" /* uint */
75 #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD                                  \
76     "tls1multi_aad"        /* octet_string */
77 #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN                          \
78     "tls1multi_aadpacklen" /* uint */
79 #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC                                  \
80     "tls1multi_enc"        /* octet_string */
81 #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN                               \
82     "tls1multi_encin"      /* octet_string */
83 #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN                              \
84     "tls1multi_enclen"     /* size_t */
85
86 /* digest parameters */
87 #define OSSL_DIGEST_PARAM_XOFLEN     "xoflen"    /* size_t */
88 #define OSSL_DIGEST_PARAM_SSL3_MS    "ssl3-ms"   /* octet string */
89 #define OSSL_DIGEST_PARAM_PAD_TYPE   "pad_type"  /* uint */
90 #define OSSL_DIGEST_PARAM_MICALG     "micalg"    /* utf8 string */
91 #define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize" /* size_t */
92 #define OSSL_DIGEST_PARAM_SIZE       "size"      /* size_t */
93 #define OSSL_DIGEST_PARAM_FLAGS      "flags"     /* ulong */
94
95 /* Known DIGEST names (not a complete list) */
96 #define OSSL_DIGEST_NAME_MD5            "MD5"
97 #define OSSL_DIGEST_NAME_MD5_SHA1       "MD5-SHA1"
98 #define OSSL_DIGEST_NAME_SHA1           "SHA1"
99 #define OSSL_DIGEST_NAME_SHA2_224       "SHA2-224"
100 #define OSSL_DIGEST_NAME_SHA2_256       "SHA2-256"
101 #define OSSL_DIGEST_NAME_SHA2_384       "SHA2-384"
102 #define OSSL_DIGEST_NAME_SHA2_512       "SHA2-512"
103 #define OSSL_DIGEST_NAME_SHA2_512_224   "SHA2-512/224"
104 #define OSSL_DIGEST_NAME_SHA2_512_256   "SHA2-512/256"
105 #define OSSL_DIGEST_NAME_MD2            "MD2"
106 #define OSSL_DIGEST_NAME_MD4            "MD4"
107 #define OSSL_DIGEST_NAME_MDC2           "MDC2"
108 #define OSSL_DIGEST_NAME_RIPEMD160      "RIPEMD160"
109 #define OSSL_DIGEST_NAME_SHA3_224       "SHA3-224"
110 #define OSSL_DIGEST_NAME_SHA3_256       "SHA3-256"
111 #define OSSL_DIGEST_NAME_SHA3_384       "SHA3-384"
112 #define OSSL_DIGEST_NAME_SHA3_512       "SHA3-512"
113 #define OSSL_DIGEST_NAME_KECCAK_KMAC128 "KECCAK-KMAC-128"
114 #define OSSL_DIGEST_NAME_KECCAK_KMAC256 "KECCAK-KMAC-256"
115
116 /* MAC parameters */
117 #define OSSL_MAC_PARAM_KEY          "key"        /* octet string */
118 #define OSSL_MAC_PARAM_IV           "iv"         /* octet string */
119 #define OSSL_MAC_PARAM_CUSTOM       "custom"     /* utf8 string */
120 #define OSSL_MAC_PARAM_SALT         "salt"       /* octet string */
121 #define OSSL_MAC_PARAM_XOF          "xof"        /* int, 0 or 1 */
122 #define OSSL_MAC_PARAM_FLAGS        "flags"      /* int */
123 /*
124  * If "engine" or "properties" are specified, they should always be paired
125  * with "cipher" or "digest".
126  */
127 #define OSSL_MAC_PARAM_CIPHER       OSSL_ALG_PARAM_CIPHER     /* utf8 string */
128 #define OSSL_MAC_PARAM_DIGEST       OSSL_ALG_PARAM_DIGEST     /* utf8 string */
129 #define OSSL_MAC_PARAM_PROPERTIES   OSSL_ALG_PARAM_PROPERTIES /* utf8 string */
130 #define OSSL_MAC_PARAM_SIZE         "size"       /* size_t */
131
132 /* Known MAC names */
133 #define OSSL_MAC_NAME_BLAKE2BMAC    "BLAKE2BMAC"
134 #define OSSL_MAC_NAME_BLAKE2SMAC    "BLAKE2SMAC"
135 #define OSSL_MAC_NAME_CMAC          "CMAC"
136 #define OSSL_MAC_NAME_GMAC          "GMAC"
137 #define OSSL_MAC_NAME_HMAC          "HMAC"
138 #define OSSL_MAC_NAME_KMAC128       "KMAC128"
139 #define OSSL_MAC_NAME_KMAC256       "KMAC256"
140 #define OSSL_MAC_NAME_POLY1305      "POLY1305"
141 #define OSSL_MAC_NAME_SIPHASH       "SIPHASH"
142
143 /* KDF / PRF parameters */
144 #define OSSL_KDF_PARAM_SECRET       "secret"    /* octet string */
145 #define OSSL_KDF_PARAM_KEY          "key"       /* octet string */
146 #define OSSL_KDF_PARAM_SALT         "salt"      /* octet string */
147 #define OSSL_KDF_PARAM_PASSWORD     "pass"      /* octet string */
148 #define OSSL_KDF_PARAM_DIGEST       OSSL_ALG_PARAM_DIGEST     /* utf8 string */
149 #define OSSL_KDF_PARAM_CIPHER       OSSL_ALG_PARAM_CIPHER     /* utf8 string */
150 #define OSSL_KDF_PARAM_MAC          OSSL_ALG_PARAM_MAC        /* utf8 string */
151 #define OSSL_KDF_PARAM_MAC_SIZE     "maclen"    /* size_t */
152 #define OSSL_KDF_PARAM_PROPERTIES   OSSL_ALG_PARAM_PROPERTIES /* utf8 string */
153 #define OSSL_KDF_PARAM_ITER         "iter"      /* unsigned int */
154 #define OSSL_KDF_PARAM_MODE         "mode"      /* utf8 string or int */
155 #define OSSL_KDF_PARAM_PKCS5        "pkcs5"     /* int */
156 #define OSSL_KDF_PARAM_UKM          "ukm"       /* octet string */
157 #define OSSL_KDF_PARAM_CEK_ALG      "cekalg"    /* utf8 string */
158 #define OSSL_KDF_PARAM_SCRYPT_N     "n"         /* uint64_t */
159 #define OSSL_KDF_PARAM_SCRYPT_R     "r"         /* uint32_t */
160 #define OSSL_KDF_PARAM_SCRYPT_P     "p"         /* uint32_t */
161 #define OSSL_KDF_PARAM_SCRYPT_MAXMEM "maxmem_bytes" /* uint64_t */
162 #define OSSL_KDF_PARAM_INFO         "info"      /* octet string */
163 #define OSSL_KDF_PARAM_SEED         "seed"      /* octet string */
164 #define OSSL_KDF_PARAM_SSHKDF_XCGHASH "xcghash" /* octet string */
165 #define OSSL_KDF_PARAM_SSHKDF_SESSION_ID "session_id" /* octet string */
166 #define OSSL_KDF_PARAM_SSHKDF_TYPE  "type"      /* int */
167 #define OSSL_KDF_PARAM_SIZE         "size"      /* size_t */
168 #define OSSL_KDF_PARAM_CIPHER       OSSL_ALG_PARAM_CIPHER     /* utf8 string */
169 #define OSSL_KDF_PARAM_CONSTANT     "constant"  /* octet string */
170
171 /* Known KDF names */
172 #define OSSL_KDF_NAME_HKDF          "HKDF"
173 #define OSSL_KDF_NAME_PBKDF2        "PBKDF2"
174 #define OSSL_KDF_NAME_SCRYPT        "SCRYPT"
175 #define OSSL_KDF_NAME_SSHKDF        "SSHKDF"
176 #define OSSL_KDF_NAME_SSKDF         "SSKDF"
177 #define OSSL_KDF_NAME_TLS1_PRF      "TLS1-PRF"
178 #define OSSL_KDF_NAME_X942KDF       "X942KDF"
179 #define OSSL_KDF_NAME_X963KDF       "X963KDF"
180 #define OSSL_KDF_NAME_KBKDF         "KBKDF"
181 #define OSSL_KDF_NAME_KRB5KDF       "KRB5KDF"
182
183 /* PKEY parameters */
184 /* Common PKEY parameters */
185 #define OSSL_PKEY_PARAM_BITS                "bits" /* integer */
186 #define OSSL_PKEY_PARAM_MAX_SIZE            "max-size" /* integer */
187 #define OSSL_PKEY_PARAM_SECURITY_BITS       "security-bits" /* integer */
188 #define OSSL_PKEY_PARAM_DIGEST              OSSL_ALG_PARAM_DIGEST
189 #define OSSL_PKEY_PARAM_PROPERTIES          OSSL_ALG_PARAM_PROPERTIES
190 #define OSSL_PKEY_PARAM_DEFAULT_DIGEST      "default-digest" /* utf8 string */
191 #define OSSL_PKEY_PARAM_MANDATORY_DIGEST    "mandatory-digest" /* utf8 string */
192 #define OSSL_PKEY_PARAM_PAD_MODE            "pad-mode"
193 #define OSSL_PKEY_PARAM_DIGEST_SIZE         "digest-size"
194 #define OSSL_PKEY_PARAM_MASKGENFUNC         "mgf"
195 #define OSSL_PKEY_PARAM_MGF1_DIGEST         "mgf1-digest"
196 #define OSSL_PKEY_PARAM_MGF1_PROPERTIES     "mgf1-properties"
197
198 /* Diffie-Hellman/DSA public/private key */
199 #define OSSL_PKEY_PARAM_PUB_KEY             "pub"
200 #define OSSL_PKEY_PARAM_PRIV_KEY            "priv"
201
202 /* Diffie-Hellman/DSA Parameters */
203 #define OSSL_PKEY_PARAM_FFC_P        "p"
204 #define OSSL_PKEY_PARAM_FFC_G        "g"
205 #define OSSL_PKEY_PARAM_FFC_Q        "q"
206 #define OSSL_PKEY_PARAM_FFC_GINDEX   "gindex"
207 #define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
208 #define OSSL_PKEY_PARAM_FFC_SEED     "seed"
209 #define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
210 #define OSSL_PKEY_PARAM_FFC_H        "hindex"
211
212 /* Diffie-Hellman params */
213 #define OSSL_PKEY_PARAM_DH_GROUP     "group"
214 #define OSSL_PKEY_PARAM_DH_GENERATOR "safeprime-generator"
215 #define OSSL_PKEY_PARAM_DH_PRIV_LEN   "priv_len"
216
217 /* Elliptic Curve Domain Parameters */
218 #define OSSL_PKEY_PARAM_EC_NAME      "curve-name"
219
220 /* Elliptic Curve Key Parameters */
221 #define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
222 #define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH \
223     OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
224
225 /* RSA Keys */
226 /*
227  * n, e, d are the usual public and private key components
228  *
229  * rsa-num is the number of factors, including p and q
230  * rsa-factor is used for each factor: p, q, r_i (i = 3, ...)
231  * rsa-exponent is used for each exponent: dP, dQ, d_i (i = 3, ...)
232  * rsa-coefficient is used for each coefficient: qInv, t_i (i = 3, ...)
233  *
234  * The number of rsa-factor items must be equal to the number of rsa-exponent
235  * items, and the number of rsa-coefficients must be one less.
236  * (the base i for the coefficients is 2, not 1, at least as implied by
237  * RFC 8017)
238  */
239 #define OSSL_PKEY_PARAM_RSA_N           "n"
240 #define OSSL_PKEY_PARAM_RSA_E           "e"
241 #define OSSL_PKEY_PARAM_RSA_D           "d"
242 #define OSSL_PKEY_PARAM_RSA_FACTOR      "rsa-factor"
243 #define OSSL_PKEY_PARAM_RSA_EXPONENT    "rsa-exponent"
244 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT "rsa-coefficient"
245 #define OSSL_PKEY_PARAM_RSA_FACTOR1      OSSL_PKEY_PARAM_RSA_FACTOR"1"
246 #define OSSL_PKEY_PARAM_RSA_FACTOR2      OSSL_PKEY_PARAM_RSA_FACTOR"2"
247 #define OSSL_PKEY_PARAM_RSA_FACTOR3      OSSL_PKEY_PARAM_RSA_FACTOR"3"
248 #define OSSL_PKEY_PARAM_RSA_FACTOR4      OSSL_PKEY_PARAM_RSA_FACTOR"4"
249 #define OSSL_PKEY_PARAM_RSA_FACTOR5      OSSL_PKEY_PARAM_RSA_FACTOR"5"
250 #define OSSL_PKEY_PARAM_RSA_FACTOR6      OSSL_PKEY_PARAM_RSA_FACTOR"6"
251 #define OSSL_PKEY_PARAM_RSA_FACTOR7      OSSL_PKEY_PARAM_RSA_FACTOR"7"
252 #define OSSL_PKEY_PARAM_RSA_FACTOR8      OSSL_PKEY_PARAM_RSA_FACTOR"8"
253 #define OSSL_PKEY_PARAM_RSA_FACTOR9      OSSL_PKEY_PARAM_RSA_FACTOR"9"
254 #define OSSL_PKEY_PARAM_RSA_FACTOR10     OSSL_PKEY_PARAM_RSA_FACTOR"10"
255 #define OSSL_PKEY_PARAM_RSA_EXPONENT1    OSSL_PKEY_PARAM_RSA_EXPONENT"1"
256 #define OSSL_PKEY_PARAM_RSA_EXPONENT2    OSSL_PKEY_PARAM_RSA_EXPONENT"2"
257 #define OSSL_PKEY_PARAM_RSA_EXPONENT3    OSSL_PKEY_PARAM_RSA_EXPONENT"3"
258 #define OSSL_PKEY_PARAM_RSA_EXPONENT4    OSSL_PKEY_PARAM_RSA_EXPONENT"4"
259 #define OSSL_PKEY_PARAM_RSA_EXPONENT5    OSSL_PKEY_PARAM_RSA_EXPONENT"5"
260 #define OSSL_PKEY_PARAM_RSA_EXPONENT6    OSSL_PKEY_PARAM_RSA_EXPONENT"6"
261 #define OSSL_PKEY_PARAM_RSA_EXPONENT7    OSSL_PKEY_PARAM_RSA_EXPONENT"7"
262 #define OSSL_PKEY_PARAM_RSA_EXPONENT8    OSSL_PKEY_PARAM_RSA_EXPONENT"8"
263 #define OSSL_PKEY_PARAM_RSA_EXPONENT9    OSSL_PKEY_PARAM_RSA_EXPONENT"9"
264 #define OSSL_PKEY_PARAM_RSA_EXPONENT10   OSSL_PKEY_PARAM_RSA_EXPONENT"10"
265 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT1 OSSL_PKEY_PARAM_RSA_COEFFICIENT"1"
266 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT2 OSSL_PKEY_PARAM_RSA_COEFFICIENT"2"
267 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT3 OSSL_PKEY_PARAM_RSA_COEFFICIENT"3"
268 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT4 OSSL_PKEY_PARAM_RSA_COEFFICIENT"4"
269 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT5 OSSL_PKEY_PARAM_RSA_COEFFICIENT"5"
270 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT6 OSSL_PKEY_PARAM_RSA_COEFFICIENT"6"
271 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT7 OSSL_PKEY_PARAM_RSA_COEFFICIENT"7"
272 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT8 OSSL_PKEY_PARAM_RSA_COEFFICIENT"8"
273 #define OSSL_PKEY_PARAM_RSA_COEFFICIENT9 OSSL_PKEY_PARAM_RSA_COEFFICIENT"9"
274
275 /* RSA padding modes */
276 #define OSSL_PKEY_RSA_PAD_MODE_NONE    "none"
277 #define OSSL_PKEY_RSA_PAD_MODE_PKCSV15 "pkcs1"
278 #define OSSL_PKEY_RSA_PAD_MODE_SSLV23  "sslv23"
279 #define OSSL_PKEY_RSA_PAD_MODE_OAEP    "oaep"
280 #define OSSL_PKEY_RSA_PAD_MODE_X931    "x931"
281 #define OSSL_PKEY_RSA_PAD_MODE_PSS     "pss"
282
283 /* RSA pss padding salt length */
284 #define OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST "digest"
285 #define OSSL_PKEY_RSA_PSS_SALT_LEN_MAX    "max"
286 #define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO   "auto"
287
288 /* Key generation parameters */
289 #define OSSL_PKEY_PARAM_RSA_BITS            OSSL_PKEY_PARAM_BITS
290 #define OSSL_PKEY_PARAM_RSA_PRIMES          "primes"
291 #define OSSL_PKEY_PARAM_RSA_DIGEST          OSSL_PKEY_PARAM_DIGEST
292 #define OSSL_PKEY_PARAM_RSA_MASKGENFUNC     OSSL_PKEY_PARAM_MASKGENFUNC
293 #define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST     OSSL_PKEY_PARAM_MGF1_DIGEST
294 #define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN     "saltlen"
295
296 /* Key generation parameters */
297 #define OSSL_PKEY_PARAM_FFC_TYPE         "type"
298 #define OSSL_PKEY_PARAM_FFC_PBITS        "pbits"
299 #define OSSL_PKEY_PARAM_FFC_QBITS        "qbits"
300 #define OSSL_PKEY_PARAM_FFC_DIGEST       OSSL_PKEY_PARAM_DIGEST
301 #define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
302
303 /* Key Exchange parameters */
304 #define OSSL_EXCHANGE_PARAM_PAD                   "pad" /* uint */
305 #define OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE "ecdh-cofactor-mode" /* int */
306 #define OSSL_EXCHANGE_PARAM_KDF_TYPE              "kdf-type" /* utf8_string */
307 #define OSSL_EXCHANGE_PARAM_KDF_DIGEST            "kdf-digest" /* utf8_string */
308 #define OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS      "kdf-digest-props" /* utf8_string */
309 #define OSSL_EXCHANGE_PARAM_KDF_OUTLEN            "kdf-outlen" /* size_t */
310
311 /*
312  * TODO(3.0): improve this pattern
313  *
314  * Currently the sole internal user of OSSL_EXCHANGE_PARAM_KDF_UKM is
315  * EVP_PKEY_CTX_{set0,get0}_ecdh_kdf_ukm():
316  *      OSSL_EXCHANGE_PARAM_KDF_UKM is handled as a octet_string on set0,
317  *      and as an octet_ptr on get0.
318  *
319  * This pattern is borrowed from the handling of
320  * OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL in
321  * EVP_PKEY_CTX_{set0,get0}_rsa_oaep_label().
322  */
323 #define OSSL_EXCHANGE_PARAM_KDF_UKM               "kdf-ukm" /* see note above */
324 #define OSSL_EXCHANGE_PARAM_KDF_UKM_LEN           "kdf-ukm-len" /* size_t */
325
326 /* Signature parameters */
327 #define OSSL_SIGNATURE_PARAM_ALGORITHM_ID       "algorithm-id"
328 #define OSSL_SIGNATURE_PARAM_PAD_MODE           OSSL_PKEY_PARAM_PAD_MODE
329 #define OSSL_SIGNATURE_PARAM_DIGEST             OSSL_PKEY_PARAM_DIGEST
330 #define OSSL_SIGNATURE_PARAM_PROPERTIES         OSSL_PKEY_PARAM_PROPERTIES
331 #define OSSL_SIGNATURE_PARAM_PSS_SALTLEN        "saltlen"
332 #define OSSL_SIGNATURE_PARAM_MGF1_DIGEST        OSSL_PKEY_PARAM_MGF1_DIGEST
333 #define OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES    \
334     OSSL_PKEY_PARAM_MGF1_PROPERTIES
335 #define OSSL_SIGNATURE_PARAM_DIGEST_SIZE        OSSL_PKEY_PARAM_DIGEST_SIZE
336 #define OSSL_SIGNATURE_PARAM_KAT                "kat"
337
338 /* Asym cipher parameters */
339 #define OSSL_ASYM_CIPHER_PARAM_PAD_MODE                 OSSL_PKEY_PARAM_PAD_MODE
340 #define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST              \
341     OSSL_PKEY_PARAM_MGF1_DIGEST
342 #define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS        \
343     OSSL_PKEY_PARAM_MGF1_PROPERTIES
344 #define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST              OSSL_ALG_PARAM_DIGEST
345 #define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS        "digest-props"
346 #define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL               "oaep-label"
347 #define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL_LEN           "oaep-label-len"
348 #define OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION       "tls-client-version"
349 #define OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION   "tls-negotiated-version"
350
351 /*
352  * Serializer parameters
353  */
354 /* The passphrase may be passed as a utf8 string or an octet string */
355 #define OSSL_SERIALIZER_PARAM_CIPHER            OSSL_ALG_PARAM_CIPHER
356 #define OSSL_SERIALIZER_PARAM_PROPERTIES        OSSL_ALG_PARAM_PROPERTIES
357 #define OSSL_SERIALIZER_PARAM_PASS              "passphrase"
358
359 /* Passphrase callback parameters */
360 #define OSSL_PASSPHRASE_PARAM_INFO              "info"
361
362 /* Keygen callback parameters, from provider to libcrypto */
363 #define OSSL_GEN_PARAM_POTENTIAL            "potential" /* integer */
364 #define OSSL_GEN_PARAM_ITERATION            "iteration" /* integer */
365
366 # ifdef __cplusplus
367 }
368 # endif
369
370 #endif