xref: /freebsd/crypto/openssl/include/openssl/core_names.h (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery /*
2*b077aed3SPierre Pronchery  * Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
3*b077aed3SPierre Pronchery  *
4*b077aed3SPierre Pronchery  * Licensed under the Apache License 2.0 (the "License").  You may not use
5*b077aed3SPierre Pronchery  * this file except in compliance with the License.  You can obtain a copy
6*b077aed3SPierre Pronchery  * in the file LICENSE in the source distribution or at
7*b077aed3SPierre Pronchery  * https://www.openssl.org/source/license.html
8*b077aed3SPierre Pronchery  */
9*b077aed3SPierre Pronchery 
10*b077aed3SPierre Pronchery #ifndef OPENSSL_CORE_NAMES_H
11*b077aed3SPierre Pronchery # define OPENSSL_CORE_NAMES_H
12*b077aed3SPierre Pronchery # pragma once
13*b077aed3SPierre Pronchery 
14*b077aed3SPierre Pronchery # ifdef __cplusplus
15*b077aed3SPierre Pronchery extern "C" {
16*b077aed3SPierre Pronchery # endif
17*b077aed3SPierre Pronchery 
18*b077aed3SPierre Pronchery /* Well known parameter names that core passes to providers */
19*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_CORE_VERSION         "openssl-version" /* utf8_ptr */
20*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_CORE_PROV_NAME       "provider-name"   /* utf8_ptr */
21*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename" /* utf8_ptr */
22*b077aed3SPierre Pronchery 
23*b077aed3SPierre Pronchery /* Well known parameter names that Providers can define */
24*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_NAME            "name"                /* utf8_ptr */
25*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_VERSION         "version"             /* utf8_ptr */
26*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_BUILDINFO       "buildinfo"           /* utf8_ptr */
27*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_STATUS          "status"              /* uint */
28*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_SECURITY_CHECKS "security-checks"     /* uint */
29*b077aed3SPierre Pronchery 
30*b077aed3SPierre Pronchery /* Self test callback parameters */
31*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_SELF_TEST_PHASE  "st-phase" /* utf8_string */
32*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_SELF_TEST_TYPE   "st-type"  /* utf8_string */
33*b077aed3SPierre Pronchery #define OSSL_PROV_PARAM_SELF_TEST_DESC   "st-desc"  /* utf8_string */
34*b077aed3SPierre Pronchery 
35*b077aed3SPierre Pronchery /*-
36*b077aed3SPierre Pronchery  * Provider-native object abstractions
37*b077aed3SPierre Pronchery  *
38*b077aed3SPierre Pronchery  * These are used when a provider wants to pass object data or an object
39*b077aed3SPierre Pronchery  * reference back to libcrypto.  This is only useful for provider functions
40*b077aed3SPierre Pronchery  * that take a callback to which an OSSL_PARAM array with these parameters
41*b077aed3SPierre Pronchery  * can be passed.
42*b077aed3SPierre Pronchery  *
43*b077aed3SPierre Pronchery  * This set of parameter names is explained in detail in provider-object(7)
44*b077aed3SPierre Pronchery  * (doc/man7/provider-object.pod)
45*b077aed3SPierre Pronchery  */
46*b077aed3SPierre Pronchery #define OSSL_OBJECT_PARAM_TYPE              "type"      /* INTEGER */
47*b077aed3SPierre Pronchery #define OSSL_OBJECT_PARAM_DATA_TYPE         "data-type" /* UTF8_STRING */
48*b077aed3SPierre Pronchery #define OSSL_OBJECT_PARAM_DATA_STRUCTURE    "data-structure" /* UTF8_STRING */
49*b077aed3SPierre Pronchery #define OSSL_OBJECT_PARAM_REFERENCE         "reference" /* OCTET_STRING */
50*b077aed3SPierre Pronchery #define OSSL_OBJECT_PARAM_DATA              "data" /* OCTET_STRING or UTF8_STRING */
51*b077aed3SPierre Pronchery #define OSSL_OBJECT_PARAM_DESC              "desc"      /* UTF8_STRING */
52*b077aed3SPierre Pronchery 
53*b077aed3SPierre Pronchery /*
54*b077aed3SPierre Pronchery  * Algorithm parameters
55*b077aed3SPierre Pronchery  * If "engine" or "properties" are specified, they should always be paired
56*b077aed3SPierre Pronchery  * with the algorithm type.
57*b077aed3SPierre Pronchery  * Note these are common names that are shared by many types (such as kdf, mac,
58*b077aed3SPierre Pronchery  * and pkey) e.g: see OSSL_MAC_PARAM_DIGEST below.
59*b077aed3SPierre Pronchery  */
60*b077aed3SPierre Pronchery #define OSSL_ALG_PARAM_DIGEST       "digest"    /* utf8_string */
61*b077aed3SPierre Pronchery #define OSSL_ALG_PARAM_CIPHER       "cipher"    /* utf8_string */
62*b077aed3SPierre Pronchery #define OSSL_ALG_PARAM_ENGINE       "engine"    /* utf8_string */
63*b077aed3SPierre Pronchery #define OSSL_ALG_PARAM_MAC          "mac"       /* utf8_string */
64*b077aed3SPierre Pronchery #define OSSL_ALG_PARAM_PROPERTIES   "properties"/* utf8_string */
65*b077aed3SPierre Pronchery 
66*b077aed3SPierre Pronchery /* cipher parameters */
67*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_PADDING              "padding"      /* uint */
68*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_USE_BITS             "use-bits"     /* uint */
69*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS_VERSION          "tls-version"  /* uint */
70*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS_MAC              "tls-mac"      /* octet_ptr */
71*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS_MAC_SIZE         "tls-mac-size" /* size_t */
72*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_MODE                 "mode"         /* uint */
73*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_BLOCK_SIZE           "blocksize"    /* size_t */
74*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD                 "aead"         /* int, 0 or 1 */
75*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_CUSTOM_IV            "custom-iv"    /* int, 0 or 1 */
76*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_CTS                  "cts"          /* int, 0 or 1 */
77*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK      "tls-multi"    /* int, 0 or 1 */
78*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_HAS_RAND_KEY         "has-randkey"  /* int, 0 or 1 */
79*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_KEYLEN               "keylen"       /* size_t */
80*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_IVLEN                "ivlen"        /* size_t */
81*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_IV                   "iv"           /* octet_string OR octet_ptr */
82*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_UPDATED_IV           "updated-iv"   /* octet_string OR octet_ptr */
83*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_NUM                  "num"          /* uint */
84*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_ROUNDS               "rounds"       /* uint */
85*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_TAG             "tag"          /* octet_string */
86*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD        "tlsaad"       /* octet_string */
87*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD    "tlsaadpad"    /* size_t */
88*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED   "tlsivfixed"   /* octet_string */
89*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN "tlsivgen"     /* octet_string */
90*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV "tlsivinv"     /* octet_string */
91*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_IVLEN           OSSL_CIPHER_PARAM_IVLEN
92*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_TAGLEN          "taglen"       /* size_t */
93*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_AEAD_MAC_KEY         "mackey"       /* octet_string */
94*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_RANDOM_KEY           "randkey"      /* octet_string */
95*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_RC2_KEYBITS          "keybits"      /* size_t */
96*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_SPEED                "speed"        /* uint */
97*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_CTS_MODE             "cts_mode"     /* utf8_string */
98*b077aed3SPierre Pronchery /* For passing the AlgorithmIdentifier parameter in DER form */
99*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS  "alg_id_param" /* octet_string */
100*b077aed3SPierre Pronchery 
101*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT                    \
102*b077aed3SPierre Pronchery     "tls1multi_maxsndfrag" /* uint */
103*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE                          \
104*b077aed3SPierre Pronchery     "tls1multi_maxbufsz"   /* size_t */
105*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE                           \
106*b077aed3SPierre Pronchery     "tls1multi_interleave" /* uint */
107*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD                                  \
108*b077aed3SPierre Pronchery     "tls1multi_aad"        /* octet_string */
109*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN                          \
110*b077aed3SPierre Pronchery     "tls1multi_aadpacklen" /* uint */
111*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC                                  \
112*b077aed3SPierre Pronchery     "tls1multi_enc"        /* octet_string */
113*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN                               \
114*b077aed3SPierre Pronchery     "tls1multi_encin"      /* octet_string */
115*b077aed3SPierre Pronchery #define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN                              \
116*b077aed3SPierre Pronchery     "tls1multi_enclen"     /* size_t */
117*b077aed3SPierre Pronchery 
118*b077aed3SPierre Pronchery /* OSSL_CIPHER_PARAM_CTS_MODE Values */
119*b077aed3SPierre Pronchery #define OSSL_CIPHER_CTS_MODE_CS1 "CS1"
120*b077aed3SPierre Pronchery #define OSSL_CIPHER_CTS_MODE_CS2 "CS2"
121*b077aed3SPierre Pronchery #define OSSL_CIPHER_CTS_MODE_CS3 "CS3"
122*b077aed3SPierre Pronchery 
123*b077aed3SPierre Pronchery /* digest parameters */
124*b077aed3SPierre Pronchery #define OSSL_DIGEST_PARAM_XOFLEN       "xoflen"        /* size_t */
125*b077aed3SPierre Pronchery #define OSSL_DIGEST_PARAM_SSL3_MS      "ssl3-ms"       /* octet string */
126*b077aed3SPierre Pronchery #define OSSL_DIGEST_PARAM_PAD_TYPE     "pad-type"      /* uint */
127*b077aed3SPierre Pronchery #define OSSL_DIGEST_PARAM_MICALG       "micalg"        /* utf8 string */
128*b077aed3SPierre Pronchery #define OSSL_DIGEST_PARAM_BLOCK_SIZE   "blocksize"     /* size_t */
129*b077aed3SPierre Pronchery #define OSSL_DIGEST_PARAM_SIZE         "size"          /* size_t */
130*b077aed3SPierre Pronchery #define OSSL_DIGEST_PARAM_XOF          "xof"           /* int, 0 or 1 */
131*b077aed3SPierre Pronchery #define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"  /* int, 0 or 1 */
132*b077aed3SPierre Pronchery 
133*b077aed3SPierre Pronchery /* Known DIGEST names (not a complete list) */
134*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_MD5            "MD5"
135*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_MD5_SHA1       "MD5-SHA1"
136*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA1           "SHA1"
137*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA2_224       "SHA2-224"
138*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA2_256       "SHA2-256"
139*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA2_384       "SHA2-384"
140*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA2_512       "SHA2-512"
141*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA2_512_224   "SHA2-512/224"
142*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA2_512_256   "SHA2-512/256"
143*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_MD2            "MD2"
144*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_MD4            "MD4"
145*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_MDC2           "MDC2"
146*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_RIPEMD160      "RIPEMD160"
147*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA3_224       "SHA3-224"
148*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA3_256       "SHA3-256"
149*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA3_384       "SHA3-384"
150*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SHA3_512       "SHA3-512"
151*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_KECCAK_KMAC128 "KECCAK-KMAC-128"
152*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_KECCAK_KMAC256 "KECCAK-KMAC-256"
153*b077aed3SPierre Pronchery #define OSSL_DIGEST_NAME_SM3            "SM3"
154*b077aed3SPierre Pronchery 
155*b077aed3SPierre Pronchery /* MAC parameters */
156*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_KEY            "key"            /* octet string */
157*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_IV             "iv"             /* octet string */
158*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_CUSTOM         "custom"         /* utf8 string */
159*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_SALT           "salt"           /* octet string */
160*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_XOF            "xof"            /* int, 0 or 1 */
161*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_DIGEST_NOINIT  "digest-noinit"  /* int, 0 or 1 */
162*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_DIGEST_ONESHOT "digest-oneshot" /* int, 0 or 1 */
163*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_C_ROUNDS       "c-rounds"       /* unsigned int */
164*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_D_ROUNDS       "d-rounds"       /* unsigned int */
165*b077aed3SPierre Pronchery 
166*b077aed3SPierre Pronchery /*
167*b077aed3SPierre Pronchery  * If "engine" or "properties" are specified, they should always be paired
168*b077aed3SPierre Pronchery  * with "cipher" or "digest".
169*b077aed3SPierre Pronchery  */
170*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_CIPHER           OSSL_ALG_PARAM_CIPHER     /* utf8 string */
171*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_DIGEST           OSSL_ALG_PARAM_DIGEST     /* utf8 string */
172*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_PROPERTIES       OSSL_ALG_PARAM_PROPERTIES /* utf8 string */
173*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_SIZE             "size"                    /* size_t */
174*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_BLOCK_SIZE       "block-size"              /* size_t */
175*b077aed3SPierre Pronchery #define OSSL_MAC_PARAM_TLS_DATA_SIZE    "tls-data-size"           /* size_t */
176*b077aed3SPierre Pronchery 
177*b077aed3SPierre Pronchery /* Known MAC names */
178*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_BLAKE2BMAC    "BLAKE2BMAC"
179*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_BLAKE2SMAC    "BLAKE2SMAC"
180*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_CMAC          "CMAC"
181*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_GMAC          "GMAC"
182*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_HMAC          "HMAC"
183*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_KMAC128       "KMAC128"
184*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_KMAC256       "KMAC256"
185*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_POLY1305      "POLY1305"
186*b077aed3SPierre Pronchery #define OSSL_MAC_NAME_SIPHASH       "SIPHASH"
187*b077aed3SPierre Pronchery 
188*b077aed3SPierre Pronchery /* KDF / PRF parameters */
189*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SECRET       "secret"    /* octet string */
190*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_KEY          "key"       /* octet string */
191*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SALT         "salt"      /* octet string */
192*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_PASSWORD     "pass"      /* octet string */
193*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_PREFIX       "prefix"    /* octet string */
194*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_LABEL        "label"     /* octet string */
195*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_DATA         "data"      /* octet string */
196*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_DIGEST       OSSL_ALG_PARAM_DIGEST     /* utf8 string */
197*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_CIPHER       OSSL_ALG_PARAM_CIPHER     /* utf8 string */
198*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_MAC          OSSL_ALG_PARAM_MAC        /* utf8 string */
199*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_MAC_SIZE     "maclen"    /* size_t */
200*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_PROPERTIES   OSSL_ALG_PARAM_PROPERTIES /* utf8 string */
201*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_ITER         "iter"      /* unsigned int */
202*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_MODE         "mode"      /* utf8 string or int */
203*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_PKCS5        "pkcs5"     /* int */
204*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_UKM          "ukm"       /* octet string */
205*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_CEK_ALG      "cekalg"    /* utf8 string */
206*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SCRYPT_N     "n"         /* uint64_t */
207*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SCRYPT_R     "r"         /* uint32_t */
208*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SCRYPT_P     "p"         /* uint32_t */
209*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SCRYPT_MAXMEM "maxmem_bytes" /* uint64_t */
210*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_INFO         "info"      /* octet string */
211*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SEED         "seed"      /* octet string */
212*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SSHKDF_XCGHASH "xcghash" /* octet string */
213*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SSHKDF_SESSION_ID "session_id" /* octet string */
214*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SSHKDF_TYPE  "type"      /* int */
215*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_SIZE         "size"      /* size_t */
216*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_CONSTANT     "constant"  /* octet string */
217*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_PKCS12_ID    "id"        /* int */
218*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_KBKDF_USE_L  "use-l"             /* int */
219*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR  "use-separator"     /* int */
220*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_X942_ACVPINFO        "acvp-info"
221*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_X942_PARTYUINFO      "partyu-info"
222*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_X942_PARTYVINFO      "partyv-info"
223*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_X942_SUPP_PUBINFO    "supp-pubinfo"
224*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_X942_SUPP_PRIVINFO   "supp-privinfo"
225*b077aed3SPierre Pronchery #define OSSL_KDF_PARAM_X942_USE_KEYBITS     "use-keybits"
226*b077aed3SPierre Pronchery 
227*b077aed3SPierre Pronchery /* Known KDF names */
228*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_HKDF           "HKDF"
229*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_TLS1_3_KDF     "TLS13-KDF"
230*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_PBKDF1         "PBKDF1"
231*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_PBKDF2         "PBKDF2"
232*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_SCRYPT         "SCRYPT"
233*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_SSHKDF         "SSHKDF"
234*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_SSKDF          "SSKDF"
235*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_TLS1_PRF       "TLS1-PRF"
236*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_X942KDF_ASN1   "X942KDF-ASN1"
237*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_X942KDF_CONCAT "X942KDF-CONCAT"
238*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_X963KDF        "X963KDF"
239*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_KBKDF          "KBKDF"
240*b077aed3SPierre Pronchery #define OSSL_KDF_NAME_KRB5KDF        "KRB5KDF"
241*b077aed3SPierre Pronchery 
242*b077aed3SPierre Pronchery /* Known RAND names */
243*b077aed3SPierre Pronchery #define OSSL_RAND_PARAM_STATE                   "state"
244*b077aed3SPierre Pronchery #define OSSL_RAND_PARAM_STRENGTH                "strength"
245*b077aed3SPierre Pronchery #define OSSL_RAND_PARAM_MAX_REQUEST             "max_request"
246*b077aed3SPierre Pronchery #define OSSL_RAND_PARAM_TEST_ENTROPY            "test_entropy"
247*b077aed3SPierre Pronchery #define OSSL_RAND_PARAM_TEST_NONCE              "test_nonce"
248*b077aed3SPierre Pronchery 
249*b077aed3SPierre Pronchery /* RAND/DRBG names */
250*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_RESEED_REQUESTS         "reseed_requests"
251*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL    "reseed_time_interval"
252*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MIN_ENTROPYLEN          "min_entropylen"
253*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MAX_ENTROPYLEN          "max_entropylen"
254*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MIN_NONCELEN            "min_noncelen"
255*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MAX_NONCELEN            "max_noncelen"
256*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MAX_PERSLEN             "max_perslen"
257*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MAX_ADINLEN             "max_adinlen"
258*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_RESEED_COUNTER          "reseed_counter"
259*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_RESEED_TIME             "reseed_time"
260*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_PROPERTIES              OSSL_ALG_PARAM_PROPERTIES
261*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_DIGEST                  OSSL_ALG_PARAM_DIGEST
262*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_CIPHER                  OSSL_ALG_PARAM_CIPHER
263*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MAC                     OSSL_ALG_PARAM_MAC
264*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_USE_DF                  "use_derivation_function"
265*b077aed3SPierre Pronchery 
266*b077aed3SPierre Pronchery /* DRBG call back parameters */
267*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_ENTROPY_REQUIRED        "entropy_required"
268*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_PREDICTION_RESISTANCE   "prediction_resistance"
269*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MIN_LENGTH              "minium_length"
270*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_MAX_LENGTH              "maxium_length"
271*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_RANDOM_DATA             "random_data"
272*b077aed3SPierre Pronchery #define OSSL_DRBG_PARAM_SIZE                    "size"
273*b077aed3SPierre Pronchery 
274*b077aed3SPierre Pronchery /* PKEY parameters */
275*b077aed3SPierre Pronchery /* Common PKEY parameters */
276*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_BITS                "bits" /* integer */
277*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_MAX_SIZE            "max-size" /* integer */
278*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_SECURITY_BITS       "security-bits" /* integer */
279*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_DIGEST              OSSL_ALG_PARAM_DIGEST
280*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_CIPHER              OSSL_ALG_PARAM_CIPHER /* utf8 string */
281*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_ENGINE              OSSL_ALG_PARAM_ENGINE /* utf8 string */
282*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_PROPERTIES          OSSL_ALG_PARAM_PROPERTIES
283*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_DEFAULT_DIGEST      "default-digest" /* utf8 string */
284*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_MANDATORY_DIGEST    "mandatory-digest" /* utf8 string */
285*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_PAD_MODE            "pad-mode"
286*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_DIGEST_SIZE         "digest-size"
287*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_MASKGENFUNC         "mgf"
288*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_MGF1_DIGEST         "mgf1-digest"
289*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_MGF1_PROPERTIES     "mgf1-properties"
290*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY  "encoded-pub-key"
291*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_GROUP_NAME          "group"
292*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_DIST_ID             "distid"
293*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_PUB_KEY             "pub"
294*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_PRIV_KEY            "priv"
295*b077aed3SPierre Pronchery 
296*b077aed3SPierre Pronchery /* Diffie-Hellman/DSA Parameters */
297*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_P               "p"
298*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_G               "g"
299*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_Q               "q"
300*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_GINDEX          "gindex"
301*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_PCOUNTER        "pcounter"
302*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_SEED            "seed"
303*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_COFACTOR        "j"
304*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_H               "hindex"
305*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ     "validate-pq"
306*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_VALIDATE_G      "validate-g"
307*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
308*b077aed3SPierre Pronchery 
309*b077aed3SPierre Pronchery /* Diffie-Hellman params */
310*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_DH_GENERATOR        "safeprime-generator"
311*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_DH_PRIV_LEN         "priv_len"
312*b077aed3SPierre Pronchery 
313*b077aed3SPierre Pronchery /* Elliptic Curve Domain Parameters */
314*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_PUB_X     "qx"
315*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_PUB_Y     "qy"
316*b077aed3SPierre Pronchery 
317*b077aed3SPierre Pronchery /* Elliptic Curve Explicit Domain Parameters */
318*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_FIELD_TYPE                   "field-type"
319*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_P                            "p"
320*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_A                            "a"
321*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_B                            "b"
322*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_GENERATOR                    "generator"
323*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_ORDER                        "order"
324*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_COFACTOR                     "cofactor"
325*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_SEED                         "seed"
326*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_CHAR2_M                      "m"
327*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_CHAR2_TYPE                   "basis-type"
328*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS               "tp"
329*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1                  "k1"
330*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2                  "k2"
331*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3                  "k3"
332*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
333*b077aed3SPierre Pronchery 
334*b077aed3SPierre Pronchery /* Elliptic Curve Key Parameters */
335*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
336*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH \
337*b077aed3SPierre Pronchery     OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
338*b077aed3SPierre Pronchery 
339*b077aed3SPierre Pronchery /* RSA Keys */
340*b077aed3SPierre Pronchery /*
341*b077aed3SPierre Pronchery  * n, e, d are the usual public and private key components
342*b077aed3SPierre Pronchery  *
343*b077aed3SPierre Pronchery  * rsa-num is the number of factors, including p and q
344*b077aed3SPierre Pronchery  * rsa-factor is used for each factor: p, q, r_i (i = 3, ...)
345*b077aed3SPierre Pronchery  * rsa-exponent is used for each exponent: dP, dQ, d_i (i = 3, ...)
346*b077aed3SPierre Pronchery  * rsa-coefficient is used for each coefficient: qInv, t_i (i = 3, ...)
347*b077aed3SPierre Pronchery  *
348*b077aed3SPierre Pronchery  * The number of rsa-factor items must be equal to the number of rsa-exponent
349*b077aed3SPierre Pronchery  * items, and the number of rsa-coefficients must be one less.
350*b077aed3SPierre Pronchery  * (the base i for the coefficients is 2, not 1, at least as implied by
351*b077aed3SPierre Pronchery  * RFC 8017)
352*b077aed3SPierre Pronchery  */
353*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_N           "n"
354*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_E           "e"
355*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_D           "d"
356*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR      "rsa-factor"
357*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT    "rsa-exponent"
358*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT "rsa-coefficient"
359*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR1      OSSL_PKEY_PARAM_RSA_FACTOR"1"
360*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR2      OSSL_PKEY_PARAM_RSA_FACTOR"2"
361*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR3      OSSL_PKEY_PARAM_RSA_FACTOR"3"
362*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR4      OSSL_PKEY_PARAM_RSA_FACTOR"4"
363*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR5      OSSL_PKEY_PARAM_RSA_FACTOR"5"
364*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR6      OSSL_PKEY_PARAM_RSA_FACTOR"6"
365*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR7      OSSL_PKEY_PARAM_RSA_FACTOR"7"
366*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR8      OSSL_PKEY_PARAM_RSA_FACTOR"8"
367*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR9      OSSL_PKEY_PARAM_RSA_FACTOR"9"
368*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_FACTOR10     OSSL_PKEY_PARAM_RSA_FACTOR"10"
369*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT1    OSSL_PKEY_PARAM_RSA_EXPONENT"1"
370*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT2    OSSL_PKEY_PARAM_RSA_EXPONENT"2"
371*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT3    OSSL_PKEY_PARAM_RSA_EXPONENT"3"
372*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT4    OSSL_PKEY_PARAM_RSA_EXPONENT"4"
373*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT5    OSSL_PKEY_PARAM_RSA_EXPONENT"5"
374*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT6    OSSL_PKEY_PARAM_RSA_EXPONENT"6"
375*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT7    OSSL_PKEY_PARAM_RSA_EXPONENT"7"
376*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT8    OSSL_PKEY_PARAM_RSA_EXPONENT"8"
377*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT9    OSSL_PKEY_PARAM_RSA_EXPONENT"9"
378*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_EXPONENT10   OSSL_PKEY_PARAM_RSA_EXPONENT"10"
379*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT1 OSSL_PKEY_PARAM_RSA_COEFFICIENT"1"
380*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT2 OSSL_PKEY_PARAM_RSA_COEFFICIENT"2"
381*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT3 OSSL_PKEY_PARAM_RSA_COEFFICIENT"3"
382*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT4 OSSL_PKEY_PARAM_RSA_COEFFICIENT"4"
383*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT5 OSSL_PKEY_PARAM_RSA_COEFFICIENT"5"
384*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT6 OSSL_PKEY_PARAM_RSA_COEFFICIENT"6"
385*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT7 OSSL_PKEY_PARAM_RSA_COEFFICIENT"7"
386*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT8 OSSL_PKEY_PARAM_RSA_COEFFICIENT"8"
387*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_COEFFICIENT9 OSSL_PKEY_PARAM_RSA_COEFFICIENT"9"
388*b077aed3SPierre Pronchery 
389*b077aed3SPierre Pronchery /* RSA padding modes */
390*b077aed3SPierre Pronchery #define OSSL_PKEY_RSA_PAD_MODE_NONE    "none"
391*b077aed3SPierre Pronchery #define OSSL_PKEY_RSA_PAD_MODE_PKCSV15 "pkcs1"
392*b077aed3SPierre Pronchery #define OSSL_PKEY_RSA_PAD_MODE_OAEP    "oaep"
393*b077aed3SPierre Pronchery #define OSSL_PKEY_RSA_PAD_MODE_X931    "x931"
394*b077aed3SPierre Pronchery #define OSSL_PKEY_RSA_PAD_MODE_PSS     "pss"
395*b077aed3SPierre Pronchery 
396*b077aed3SPierre Pronchery /* RSA pss padding salt length */
397*b077aed3SPierre Pronchery #define OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST "digest"
398*b077aed3SPierre Pronchery #define OSSL_PKEY_RSA_PSS_SALT_LEN_MAX    "max"
399*b077aed3SPierre Pronchery #define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO   "auto"
400*b077aed3SPierre Pronchery 
401*b077aed3SPierre Pronchery /* Key generation parameters */
402*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_BITS             OSSL_PKEY_PARAM_BITS
403*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_PRIMES           "primes"
404*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_DIGEST           OSSL_PKEY_PARAM_DIGEST
405*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_DIGEST_PROPS     OSSL_PKEY_PARAM_PROPERTIES
406*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_MASKGENFUNC      OSSL_PKEY_PARAM_MASKGENFUNC
407*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST      OSSL_PKEY_PARAM_MGF1_DIGEST
408*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN      "saltlen"
409*b077aed3SPierre Pronchery 
410*b077aed3SPierre Pronchery /* Key generation parameters */
411*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_TYPE         "type"
412*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_PBITS        "pbits"
413*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_QBITS        "qbits"
414*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_DIGEST       OSSL_PKEY_PARAM_DIGEST
415*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
416*b077aed3SPierre Pronchery 
417*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_ENCODING                "encoding" /* utf8_string */
418*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
419*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE        "group-check"
420*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC          "include-public"
421*b077aed3SPierre Pronchery 
422*b077aed3SPierre Pronchery /* OSSL_PKEY_PARAM_EC_ENCODING values */
423*b077aed3SPierre Pronchery #define OSSL_PKEY_EC_ENCODING_EXPLICIT  "explicit"
424*b077aed3SPierre Pronchery #define OSSL_PKEY_EC_ENCODING_GROUP     "named_curve"
425*b077aed3SPierre Pronchery 
426*b077aed3SPierre Pronchery #define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_UNCOMPRESSED "uncompressed"
427*b077aed3SPierre Pronchery #define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_COMPRESSED   "compressed"
428*b077aed3SPierre Pronchery #define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_HYBRID       "hybrid"
429*b077aed3SPierre Pronchery 
430*b077aed3SPierre Pronchery #define OSSL_PKEY_EC_GROUP_CHECK_DEFAULT     "default"
431*b077aed3SPierre Pronchery #define OSSL_PKEY_EC_GROUP_CHECK_NAMED       "named"
432*b077aed3SPierre Pronchery #define OSSL_PKEY_EC_GROUP_CHECK_NAMED_NIST  "named-nist"
433*b077aed3SPierre Pronchery 
434*b077aed3SPierre Pronchery /* Key Exchange parameters */
435*b077aed3SPierre Pronchery #define OSSL_EXCHANGE_PARAM_PAD                   "pad" /* uint */
436*b077aed3SPierre Pronchery #define OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE "ecdh-cofactor-mode" /* int */
437*b077aed3SPierre Pronchery #define OSSL_EXCHANGE_PARAM_KDF_TYPE              "kdf-type" /* utf8_string */
438*b077aed3SPierre Pronchery #define OSSL_EXCHANGE_PARAM_KDF_DIGEST            "kdf-digest" /* utf8_string */
439*b077aed3SPierre Pronchery #define OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS      "kdf-digest-props" /* utf8_string */
440*b077aed3SPierre Pronchery #define OSSL_EXCHANGE_PARAM_KDF_OUTLEN            "kdf-outlen" /* size_t */
441*b077aed3SPierre Pronchery /* The following parameter is an octet_string on set and an octet_ptr on get */
442*b077aed3SPierre Pronchery #define OSSL_EXCHANGE_PARAM_KDF_UKM               "kdf-ukm"
443*b077aed3SPierre Pronchery 
444*b077aed3SPierre Pronchery /* Signature parameters */
445*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_ALGORITHM_ID       "algorithm-id"
446*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_PAD_MODE           OSSL_PKEY_PARAM_PAD_MODE
447*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_DIGEST             OSSL_PKEY_PARAM_DIGEST
448*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_PROPERTIES         OSSL_PKEY_PARAM_PROPERTIES
449*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_PSS_SALTLEN        "saltlen"
450*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_MGF1_DIGEST        OSSL_PKEY_PARAM_MGF1_DIGEST
451*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES    \
452*b077aed3SPierre Pronchery     OSSL_PKEY_PARAM_MGF1_PROPERTIES
453*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_DIGEST_SIZE        OSSL_PKEY_PARAM_DIGEST_SIZE
454*b077aed3SPierre Pronchery 
455*b077aed3SPierre Pronchery /* Asym cipher parameters */
456*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_DIGEST                   OSSL_PKEY_PARAM_DIGEST
457*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_PROPERTIES               OSSL_PKEY_PARAM_PROPERTIES
458*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_ENGINE                   OSSL_PKEY_PARAM_ENGINE
459*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_PAD_MODE                 OSSL_PKEY_PARAM_PAD_MODE
460*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST              \
461*b077aed3SPierre Pronchery     OSSL_PKEY_PARAM_MGF1_DIGEST
462*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS        \
463*b077aed3SPierre Pronchery     OSSL_PKEY_PARAM_MGF1_PROPERTIES
464*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST              OSSL_ALG_PARAM_DIGEST
465*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS        "digest-props"
466*b077aed3SPierre Pronchery /* The following parameter is an octet_string on set and an octet_ptr on get */
467*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL               "oaep-label"
468*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION       "tls-client-version"
469*b077aed3SPierre Pronchery #define OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION   "tls-negotiated-version"
470*b077aed3SPierre Pronchery 
471*b077aed3SPierre Pronchery /*
472*b077aed3SPierre Pronchery  * Encoder / decoder parameters
473*b077aed3SPierre Pronchery  */
474*b077aed3SPierre Pronchery #define OSSL_ENCODER_PARAM_CIPHER           OSSL_ALG_PARAM_CIPHER
475*b077aed3SPierre Pronchery #define OSSL_ENCODER_PARAM_PROPERTIES       OSSL_ALG_PARAM_PROPERTIES
476*b077aed3SPierre Pronchery /* Currently PVK only, but reusable for others as needed */
477*b077aed3SPierre Pronchery #define OSSL_ENCODER_PARAM_ENCRYPT_LEVEL    "encrypt-level"
478*b077aed3SPierre Pronchery #define OSSL_ENCODER_PARAM_SAVE_PARAMETERS  "save-parameters" /* integer */
479*b077aed3SPierre Pronchery 
480*b077aed3SPierre Pronchery #define OSSL_DECODER_PARAM_PROPERTIES       OSSL_ALG_PARAM_PROPERTIES
481*b077aed3SPierre Pronchery 
482*b077aed3SPierre Pronchery /* Passphrase callback parameters */
483*b077aed3SPierre Pronchery #define OSSL_PASSPHRASE_PARAM_INFO      "info"
484*b077aed3SPierre Pronchery 
485*b077aed3SPierre Pronchery /* Keygen callback parameters, from provider to libcrypto */
486*b077aed3SPierre Pronchery #define OSSL_GEN_PARAM_POTENTIAL            "potential" /* integer */
487*b077aed3SPierre Pronchery #define OSSL_GEN_PARAM_ITERATION            "iteration" /* integer */
488*b077aed3SPierre Pronchery 
489*b077aed3SPierre Pronchery /* ACVP Test parameters : These should not be used normally */
490*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_XP1 "xp1"
491*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_XP2 "xp2"
492*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_XP  "xp"
493*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_XQ1 "xq1"
494*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_XQ2 "xq2"
495*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_XQ  "xq"
496*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_P1  "p1"
497*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_P2  "p2"
498*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_Q1  "q1"
499*b077aed3SPierre Pronchery #define OSSL_PKEY_PARAM_RSA_TEST_Q2  "q2"
500*b077aed3SPierre Pronchery #define OSSL_SIGNATURE_PARAM_KAT "kat"
501*b077aed3SPierre Pronchery 
502*b077aed3SPierre Pronchery /* KEM parameters */
503*b077aed3SPierre Pronchery #define OSSL_KEM_PARAM_OPERATION            "operation"
504*b077aed3SPierre Pronchery 
505*b077aed3SPierre Pronchery /* OSSL_KEM_PARAM_OPERATION values */
506*b077aed3SPierre Pronchery #define OSSL_KEM_PARAM_OPERATION_RSASVE     "RSASVE"
507*b077aed3SPierre Pronchery 
508*b077aed3SPierre Pronchery /* Capabilities */
509*b077aed3SPierre Pronchery 
510*b077aed3SPierre Pronchery /* TLS-GROUP Capability */
511*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_NAME              "tls-group-name"
512*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL     "tls-group-name-internal"
513*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_ID                "tls-group-id"
514*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_ALG               "tls-group-alg"
515*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS     "tls-group-sec-bits"
516*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_IS_KEM            "tls-group-is-kem"
517*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_MIN_TLS           "tls-min-tls"
518*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_MAX_TLS           "tls-max-tls"
519*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS          "tls-min-dtls"
520*b077aed3SPierre Pronchery #define OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS          "tls-max-dtls"
521*b077aed3SPierre Pronchery 
522*b077aed3SPierre Pronchery /*-
523*b077aed3SPierre Pronchery  * storemgmt parameters
524*b077aed3SPierre Pronchery  */
525*b077aed3SPierre Pronchery 
526*b077aed3SPierre Pronchery /*
527*b077aed3SPierre Pronchery  * Used by storemgmt_ctx_set_params():
528*b077aed3SPierre Pronchery  *
529*b077aed3SPierre Pronchery  * - OSSL_STORE_PARAM_EXPECT is an INTEGER, and the value is any of the
530*b077aed3SPierre Pronchery  *   OSSL_STORE_INFO numbers.  This is used to set the expected type of
531*b077aed3SPierre Pronchery  *   object loaded.
532*b077aed3SPierre Pronchery  *
533*b077aed3SPierre Pronchery  * - OSSL_STORE_PARAM_SUBJECT, OSSL_STORE_PARAM_ISSUER,
534*b077aed3SPierre Pronchery  *   OSSL_STORE_PARAM_SERIAL, OSSL_STORE_PARAM_FINGERPRINT,
535*b077aed3SPierre Pronchery  *   OSSL_STORE_PARAM_DIGEST, OSSL_STORE_PARAM_ALIAS
536*b077aed3SPierre Pronchery  *   are used as search criteria.
537*b077aed3SPierre Pronchery  *   (OSSL_STORE_PARAM_DIGEST is used with OSSL_STORE_PARAM_FINGERPRINT)
538*b077aed3SPierre Pronchery  */
539*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_EXPECT     "expect"       /* INTEGER */
540*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_SUBJECT    "subject" /* DER blob => OCTET_STRING */
541*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_ISSUER     "name" /* DER blob => OCTET_STRING */
542*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_SERIAL     "serial"       /* INTEGER */
543*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_DIGEST     "digest"       /* UTF8_STRING */
544*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_FINGERPRINT "fingerprint" /* OCTET_STRING */
545*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_ALIAS      "alias"        /* UTF8_STRING */
546*b077aed3SPierre Pronchery 
547*b077aed3SPierre Pronchery /* You may want to pass properties for the provider implementation to use */
548*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_PROPERTIES "properties"   /* utf8_string */
549*b077aed3SPierre Pronchery /* OSSL_DECODER input type if a decoder is used by the store */
550*b077aed3SPierre Pronchery #define OSSL_STORE_PARAM_INPUT_TYPE "input-type"   /* UTF8_STRING */
551*b077aed3SPierre Pronchery 
552*b077aed3SPierre Pronchery # ifdef __cplusplus
553*b077aed3SPierre Pronchery }
554*b077aed3SPierre Pronchery # endif
555*b077aed3SPierre Pronchery 
556*b077aed3SPierre Pronchery #endif
557