2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
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
10 #ifndef OPENSSL_CORE_NUMBERS_H
11 # define OPENSSL_CORE_NUMBERS_H
14 # include <openssl/core.h>
15 # include <openssl/self_test.h>
25 * All series start with 1, to allow 0 to be an array terminator.
26 * For any FUNC identity, we also provide a function signature typedef
27 * and a static inline function to extract a function pointer from a
28 * OSSL_DISPATCH element in a type safe manner.
31 * for any function base name 'foo' (uppercase form 'FOO'), we will have
33 * - a macro for the identity with the name OSSL_FUNC_'FOO' or derivatives
34 * thereof (to be specified further down)
35 * - a function signature typedef with the name OSSL_'foo'_fn
36 * - a function pointer extractor function with the name OSSL_'foo'
40 * Helper macro to create the function signature typedef and the extractor
41 * |type| is the return-type of the function, |name| is the name of the
42 * function to fetch, and |args| is a parenthesized list of parameters
43 * for the function (that is, it is |name|'s function signature).
45 #define OSSL_CORE_MAKE_FUNC(type,name,args) \
46 typedef type (OSSL_##name##_fn)args; \
48 OSSL_##name##_fn *OSSL_get_##name(const OSSL_DISPATCH *opf) \
50 return (OSSL_##name##_fn *)opf->function; \
54 * Core function identities, for the two OSSL_DISPATCH tables being passed
55 * in the OSSL_provider_init call.
57 * 0 serves as a marker for the end of the OSSL_DISPATCH array, and must
58 * therefore NEVER be used as a function identity.
60 /* Functions provided by the Core to the provider, reserved numbers 1-1023 */
61 # define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
62 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*,
63 core_gettable_params
,(const OSSL_PROVIDER
*prov
))
64 # define OSSL_FUNC_CORE_GET_PARAMS 2
65 OSSL_CORE_MAKE_FUNC(int,core_get_params
,(const OSSL_PROVIDER
*prov
,
67 # define OSSL_FUNC_CORE_THREAD_START 3
68 OSSL_CORE_MAKE_FUNC(int,core_thread_start
,(const OSSL_PROVIDER
*prov
,
69 OSSL_thread_stop_handler_fn handfn
))
70 # define OSSL_FUNC_CORE_GET_LIBRARY_CONTEXT 4
71 OSSL_CORE_MAKE_FUNC(OPENSSL_CTX
*,core_get_library_context
,
72 (const OSSL_PROVIDER
*prov
))
73 # define OSSL_FUNC_CORE_NEW_ERROR 5
74 OSSL_CORE_MAKE_FUNC(void,core_new_error
,(const OSSL_PROVIDER
*prov
))
75 # define OSSL_FUNC_CORE_SET_ERROR_DEBUG 6
76 OSSL_CORE_MAKE_FUNC(void,core_set_error_debug
,
77 (const OSSL_PROVIDER
*prov
,
78 const char *file
, int line
, const char *func
))
79 # define OSSL_FUNC_CORE_VSET_ERROR 7
80 OSSL_CORE_MAKE_FUNC(void,core_vset_error
,
81 (const OSSL_PROVIDER
*prov
,
82 uint32_t reason
, const char *fmt
, va_list args
))
83 # define OSSL_FUNC_CORE_SET_ERROR_MARK 8
84 OSSL_CORE_MAKE_FUNC(int, core_set_error_mark
, (const OSSL_PROVIDER
*prov
))
85 # define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9
86 OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark
,
87 (const OSSL_PROVIDER
*prov
))
88 # define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10
89 OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark
, (const OSSL_PROVIDER
*prov
))
91 /* Memory allocation, freeing, clearing. */
92 #define OSSL_FUNC_CRYPTO_MALLOC 20
93 OSSL_CORE_MAKE_FUNC(void *,
94 CRYPTO_malloc
, (size_t num
, const char *file
, int line
))
95 #define OSSL_FUNC_CRYPTO_ZALLOC 21
96 OSSL_CORE_MAKE_FUNC(void *,
97 CRYPTO_zalloc
, (size_t num
, const char *file
, int line
))
98 #define OSSL_FUNC_CRYPTO_FREE 22
99 OSSL_CORE_MAKE_FUNC(void,
100 CRYPTO_free
, (void *ptr
, const char *file
, int line
))
101 #define OSSL_FUNC_CRYPTO_CLEAR_FREE 23
102 OSSL_CORE_MAKE_FUNC(void,
103 CRYPTO_clear_free
, (void *ptr
, size_t num
, const char *file
, int line
))
104 #define OSSL_FUNC_CRYPTO_REALLOC 24
105 OSSL_CORE_MAKE_FUNC(void *,
106 CRYPTO_realloc
, (void *addr
, size_t num
, const char *file
, int line
))
107 #define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 25
108 OSSL_CORE_MAKE_FUNC(void *,
109 CRYPTO_clear_realloc
, (void *addr
, size_t old_num
, size_t num
,
110 const char *file
, int line
))
111 #define OSSL_FUNC_CRYPTO_SECURE_MALLOC 26
112 OSSL_CORE_MAKE_FUNC(void *,
113 CRYPTO_secure_malloc
, (size_t num
, const char *file
, int line
))
114 #define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 27
115 OSSL_CORE_MAKE_FUNC(void *,
116 CRYPTO_secure_zalloc
, (size_t num
, const char *file
, int line
))
117 #define OSSL_FUNC_CRYPTO_SECURE_FREE 28
118 OSSL_CORE_MAKE_FUNC(void,
119 CRYPTO_secure_free
, (void *ptr
, const char *file
, int line
))
120 #define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 29
121 OSSL_CORE_MAKE_FUNC(void,
122 CRYPTO_secure_clear_free
, (void *ptr
, size_t num
, const char *file
,
124 #define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 30
125 OSSL_CORE_MAKE_FUNC(int,
126 CRYPTO_secure_allocated
, (const void *ptr
))
127 #define OSSL_FUNC_OPENSSL_CLEANSE 31
128 OSSL_CORE_MAKE_FUNC(void,
129 OPENSSL_cleanse
, (void *ptr
, size_t len
))
131 /* Bio functions provided by the core */
132 #define OSSL_FUNC_BIO_NEW_FILE 40
133 #define OSSL_FUNC_BIO_NEW_MEMBUF 41
134 #define OSSL_FUNC_BIO_READ_EX 42
135 #define OSSL_FUNC_BIO_FREE 43
136 #define OSSL_FUNC_BIO_VPRINTF 44
138 OSSL_CORE_MAKE_FUNC(BIO
*, BIO_new_file
, (const char *filename
, const char *mode
))
139 OSSL_CORE_MAKE_FUNC(BIO
*, BIO_new_membuf
, (const void *buf
, int len
))
140 OSSL_CORE_MAKE_FUNC(int, BIO_read_ex
, (BIO
*bio
, void *data
, size_t data_len
,
142 OSSL_CORE_MAKE_FUNC(int, BIO_free
, (BIO
*bio
))
143 OSSL_CORE_MAKE_FUNC(int, BIO_vprintf
, (BIO
*bio
, const char *format
,
146 #define OSSL_FUNC_SELF_TEST_CB 100
147 OSSL_CORE_MAKE_FUNC(void, self_test_cb
, (OPENSSL_CTX
*ctx
, OSSL_CALLBACK
**cb
,
150 /* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
151 # define OSSL_FUNC_PROVIDER_TEARDOWN 1024
152 OSSL_CORE_MAKE_FUNC(void,provider_teardown
,(void *provctx
))
153 # define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025
154 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*,
155 provider_gettable_params
,(void *provctx
))
156 # define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
157 OSSL_CORE_MAKE_FUNC(int,provider_get_params
,(void *provctx
,
158 OSSL_PARAM params
[]))
159 # define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
160 OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM
*,provider_query_operation
,
161 (void *provctx
, int operation_id
, const int *no_store
))
162 # define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1028
163 OSSL_CORE_MAKE_FUNC(const OSSL_ITEM
*,provider_get_reason_strings
,
168 # define OSSL_OP_DIGEST 1
169 # define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
170 # define OSSL_OP_MAC 3
171 # define OSSL_OP_KDF 4
172 # define OSSL_OP_KEYMGMT 10
173 # define OSSL_OP_KEYEXCH 11
174 # define OSSL_OP_SIGNATURE 12
175 # define OSSL_OP_ASYM_CIPHER 13
176 /* New section for non-EVP operations */
177 # define OSSL_OP_SERIALIZER 20
178 /* Highest known operation number */
179 # define OSSL_OP__HIGHEST 20
183 # define OSSL_FUNC_DIGEST_NEWCTX 1
184 # define OSSL_FUNC_DIGEST_INIT 2
185 # define OSSL_FUNC_DIGEST_UPDATE 3
186 # define OSSL_FUNC_DIGEST_FINAL 4
187 # define OSSL_FUNC_DIGEST_DIGEST 5
188 # define OSSL_FUNC_DIGEST_FREECTX 6
189 # define OSSL_FUNC_DIGEST_DUPCTX 7
190 # define OSSL_FUNC_DIGEST_GET_PARAMS 8
191 # define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9
192 # define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10
193 # define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
194 # define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
195 # define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
197 OSSL_CORE_MAKE_FUNC(void *, OP_digest_newctx
, (void *provctx
))
198 OSSL_CORE_MAKE_FUNC(int, OP_digest_init
, (void *dctx
))
199 OSSL_CORE_MAKE_FUNC(int, OP_digest_update
,
200 (void *dctx
, const unsigned char *in
, size_t inl
))
201 OSSL_CORE_MAKE_FUNC(int, OP_digest_final
,
203 unsigned char *out
, size_t *outl
, size_t outsz
))
204 OSSL_CORE_MAKE_FUNC(int, OP_digest_digest
,
205 (void *provctx
, const unsigned char *in
, size_t inl
,
206 unsigned char *out
, size_t *outl
, size_t outsz
))
208 OSSL_CORE_MAKE_FUNC(void, OP_digest_freectx
, (void *dctx
))
209 OSSL_CORE_MAKE_FUNC(void *, OP_digest_dupctx
, (void *dctx
))
211 OSSL_CORE_MAKE_FUNC(int, OP_digest_get_params
, (OSSL_PARAM params
[]))
212 OSSL_CORE_MAKE_FUNC(int, OP_digest_set_ctx_params
,
213 (void *vctx
, const OSSL_PARAM params
[]))
214 OSSL_CORE_MAKE_FUNC(int, OP_digest_get_ctx_params
,
215 (void *vctx
, OSSL_PARAM params
[]))
216 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_digest_gettable_params
, (void))
217 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_digest_settable_ctx_params
, (void))
218 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_digest_gettable_ctx_params
, (void))
220 /* Symmetric Ciphers */
222 # define OSSL_FUNC_CIPHER_NEWCTX 1
223 # define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2
224 # define OSSL_FUNC_CIPHER_DECRYPT_INIT 3
225 # define OSSL_FUNC_CIPHER_UPDATE 4
226 # define OSSL_FUNC_CIPHER_FINAL 5
227 # define OSSL_FUNC_CIPHER_CIPHER 6
228 # define OSSL_FUNC_CIPHER_FREECTX 7
229 # define OSSL_FUNC_CIPHER_DUPCTX 8
230 # define OSSL_FUNC_CIPHER_GET_PARAMS 9
231 # define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10
232 # define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11
233 # define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
234 # define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
235 # define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
237 OSSL_CORE_MAKE_FUNC(void *, OP_cipher_newctx
, (void *provctx
))
238 OSSL_CORE_MAKE_FUNC(int, OP_cipher_encrypt_init
, (void *cctx
,
239 const unsigned char *key
,
241 const unsigned char *iv
,
243 OSSL_CORE_MAKE_FUNC(int, OP_cipher_decrypt_init
, (void *cctx
,
244 const unsigned char *key
,
246 const unsigned char *iv
,
248 OSSL_CORE_MAKE_FUNC(int, OP_cipher_update
,
250 unsigned char *out
, size_t *outl
, size_t outsize
,
251 const unsigned char *in
, size_t inl
))
252 OSSL_CORE_MAKE_FUNC(int, OP_cipher_final
,
254 unsigned char *out
, size_t *outl
, size_t outsize
))
255 OSSL_CORE_MAKE_FUNC(int, OP_cipher_cipher
,
257 unsigned char *out
, size_t *outl
, size_t outsize
,
258 const unsigned char *in
, size_t inl
))
259 OSSL_CORE_MAKE_FUNC(void, OP_cipher_freectx
, (void *cctx
))
260 OSSL_CORE_MAKE_FUNC(void *, OP_cipher_dupctx
, (void *cctx
))
261 OSSL_CORE_MAKE_FUNC(int, OP_cipher_get_params
, (OSSL_PARAM params
[]))
262 OSSL_CORE_MAKE_FUNC(int, OP_cipher_get_ctx_params
, (void *cctx
,
263 OSSL_PARAM params
[]))
264 OSSL_CORE_MAKE_FUNC(int, OP_cipher_set_ctx_params
, (void *cctx
,
265 const OSSL_PARAM params
[]))
266 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_cipher_gettable_params
, (void))
267 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_cipher_settable_ctx_params
, (void))
268 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_cipher_gettable_ctx_params
, (void))
272 # define OSSL_FUNC_MAC_NEWCTX 1
273 # define OSSL_FUNC_MAC_DUPCTX 2
274 # define OSSL_FUNC_MAC_FREECTX 3
275 # define OSSL_FUNC_MAC_INIT 4
276 # define OSSL_FUNC_MAC_UPDATE 5
277 # define OSSL_FUNC_MAC_FINAL 6
278 # define OSSL_FUNC_MAC_GET_PARAMS 7
279 # define OSSL_FUNC_MAC_GET_CTX_PARAMS 8
280 # define OSSL_FUNC_MAC_SET_CTX_PARAMS 9
281 # define OSSL_FUNC_MAC_GETTABLE_PARAMS 10
282 # define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS 11
283 # define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS 12
285 OSSL_CORE_MAKE_FUNC(void *, OP_mac_newctx
, (void *provctx
))
286 OSSL_CORE_MAKE_FUNC(void *, OP_mac_dupctx
, (void *src
))
287 OSSL_CORE_MAKE_FUNC(void, OP_mac_freectx
, (void *mctx
))
288 OSSL_CORE_MAKE_FUNC(size_t, OP_mac_size
, (void *mctx
))
289 OSSL_CORE_MAKE_FUNC(int, OP_mac_init
, (void *mctx
))
290 OSSL_CORE_MAKE_FUNC(int, OP_mac_update
,
291 (void *mctx
, const unsigned char *in
, size_t inl
))
292 OSSL_CORE_MAKE_FUNC(int, OP_mac_final
,
294 unsigned char *out
, size_t *outl
, size_t outsize
))
295 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_mac_gettable_params
, (void))
296 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_mac_gettable_ctx_params
, (void))
297 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_mac_settable_ctx_params
, (void))
298 OSSL_CORE_MAKE_FUNC(int, OP_mac_get_params
, (OSSL_PARAM params
[]))
299 OSSL_CORE_MAKE_FUNC(int, OP_mac_get_ctx_params
,
300 (void *mctx
, OSSL_PARAM params
[]))
301 OSSL_CORE_MAKE_FUNC(int, OP_mac_set_ctx_params
,
302 (void *mctx
, const OSSL_PARAM params
[]))
306 # define OSSL_FUNC_KDF_NEWCTX 1
307 # define OSSL_FUNC_KDF_DUPCTX 2
308 # define OSSL_FUNC_KDF_FREECTX 3
309 # define OSSL_FUNC_KDF_RESET 4
310 # define OSSL_FUNC_KDF_DERIVE 5
311 # define OSSL_FUNC_KDF_GETTABLE_PARAMS 6
312 # define OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 7
313 # define OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 8
314 # define OSSL_FUNC_KDF_GET_PARAMS 9
315 # define OSSL_FUNC_KDF_GET_CTX_PARAMS 10
316 # define OSSL_FUNC_KDF_SET_CTX_PARAMS 11
318 OSSL_CORE_MAKE_FUNC(void *, OP_kdf_newctx
, (void *provctx
))
319 OSSL_CORE_MAKE_FUNC(void *, OP_kdf_dupctx
, (void *src
))
320 OSSL_CORE_MAKE_FUNC(void, OP_kdf_freectx
, (void *kctx
))
321 OSSL_CORE_MAKE_FUNC(void, OP_kdf_reset
, (void *kctx
))
322 OSSL_CORE_MAKE_FUNC(int, OP_kdf_derive
, (void *kctx
, unsigned char *key
,
324 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_kdf_gettable_params
, (void))
325 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_kdf_gettable_ctx_params
, (void))
326 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_kdf_settable_ctx_params
, (void))
327 OSSL_CORE_MAKE_FUNC(int, OP_kdf_get_params
, (OSSL_PARAM params
[]))
328 OSSL_CORE_MAKE_FUNC(int, OP_kdf_get_ctx_params
,
329 (void *kctx
, OSSL_PARAM params
[]))
330 OSSL_CORE_MAKE_FUNC(int, OP_kdf_set_ctx_params
,
331 (void *kctx
, const OSSL_PARAM params
[]))
336 * The Key Management takes care of provider side key objects, and includes
337 * all current functionality to create them, destroy them, set parameters
338 * and key material, etc, essentially everything that manipulates the keys
339 * themselves and their parameters.
341 * The key objects are commonly refered to as |keydata|, and it MUST be able
342 * to contain parameters if the key has any, the public key and the private
343 * key. All parts are optional, but their presence determines what can be
344 * done with the key object in terms of encryption, signature, and so on.
345 * The assumption from libcrypto is that the key object contains any of the
346 * following data combinations:
350 * - public key + private key
351 * - parameters + public key
352 * - parameters + public key + private key
354 * What "parameters", "public key" and "private key" means in detail is left
355 * to the implementation. In the case of DH and DSA, they would typically
356 * include domain parameters, while for certain variants of RSA, they would
357 * typically include PSS or OAEP parameters.
359 * Key objects are created with OP_keymgmt_new() and destroyed with
360 * Op_keymgmt_free(). Key objects can have data filled in with
361 * OP_keymgmt_import().
363 * Three functions are made available to check what selection of data is
364 * present in a key object: OP_keymgmt_has_parameters(),
365 * OP_keymgmt_has_public_key(), and OP_keymgmt_has_private_key(),
368 /* Key data subset selection - individual bits */
369 # define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
370 # define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
371 # define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
372 # define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
374 /* Key data subset selection - combinations */
375 # define OSSL_KEYMGMT_SELECT_ALL_PARAMETERS \
376 ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
377 | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
378 # define OSSL_KEYMGMT_SELECT_KEYPAIR \
379 ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
380 # define OSSL_KEYMGMT_SELECT_ALL \
381 ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
383 /* Basic key object creation, destruction */
384 # define OSSL_FUNC_KEYMGMT_NEW 1
385 # define OSSL_FUNC_KEYMGMT_FREE 9
386 OSSL_CORE_MAKE_FUNC(void *, OP_keymgmt_new
, (void *provctx
))
387 OSSL_CORE_MAKE_FUNC(void, OP_keymgmt_free
, (void *keydata
))
389 /* Key object information, with discovery */
390 #define OSSL_FUNC_KEYMGMT_GET_PARAMS 10
391 #define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS 11
392 OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_get_params
,
393 (void *keydata
, OSSL_PARAM params
[]))
394 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_keymgmt_gettable_params
, (void))
396 /* Key checks - discovery of supported operations */
397 # define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20
398 OSSL_CORE_MAKE_FUNC(const char *, OP_keymgmt_query_operation_name
,
401 /* Key checks - key data content checks */
402 # define OSSL_FUNC_KEYMGMT_HAS 21
403 OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_has
, (void *keydata
, int selection
))
405 /* Key checks - validation */
406 # define OSSL_FUNC_KEYMGMT_VALIDATE 22
407 OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_validate
, (void *keydata
, int selection
))
409 /* Import and export functions, with ddiscovery */
410 # define OSSL_FUNC_KEYMGMT_IMPORT 40
411 # define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41
412 # define OSSL_FUNC_KEYMGMT_EXPORT 42
413 # define OSSL_FUNC_KEYMGMT_EXPORT_TYPES 43
414 OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_import
,
415 (void *keydata
, int selection
, const OSSL_PARAM params
[]))
416 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_keymgmt_import_types
,
418 OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_export
,
419 (void *keydata
, int selection
,
420 OSSL_CALLBACK
*param_cb
, void *cbarg
))
421 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_keymgmt_export_types
,
426 # define OSSL_FUNC_KEYEXCH_NEWCTX 1
427 # define OSSL_FUNC_KEYEXCH_INIT 2
428 # define OSSL_FUNC_KEYEXCH_DERIVE 3
429 # define OSSL_FUNC_KEYEXCH_SET_PEER 4
430 # define OSSL_FUNC_KEYEXCH_FREECTX 5
431 # define OSSL_FUNC_KEYEXCH_DUPCTX 6
432 # define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS 7
433 # define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8
435 OSSL_CORE_MAKE_FUNC(void *, OP_keyexch_newctx
, (void *provctx
))
436 OSSL_CORE_MAKE_FUNC(int, OP_keyexch_init
, (void *ctx
, void *provkey
))
437 OSSL_CORE_MAKE_FUNC(int, OP_keyexch_derive
, (void *ctx
, unsigned char *secret
,
438 size_t *secretlen
, size_t outlen
))
439 OSSL_CORE_MAKE_FUNC(int, OP_keyexch_set_peer
, (void *ctx
, void *provkey
))
440 OSSL_CORE_MAKE_FUNC(void, OP_keyexch_freectx
, (void *ctx
))
441 OSSL_CORE_MAKE_FUNC(void *, OP_keyexch_dupctx
, (void *ctx
))
442 OSSL_CORE_MAKE_FUNC(int, OP_keyexch_set_ctx_params
, (void *ctx
,
443 const OSSL_PARAM params
[]))
444 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_keyexch_settable_ctx_params
,
449 # define OSSL_FUNC_SIGNATURE_NEWCTX 1
450 # define OSSL_FUNC_SIGNATURE_SIGN_INIT 2
451 # define OSSL_FUNC_SIGNATURE_SIGN 3
452 # define OSSL_FUNC_SIGNATURE_VERIFY_INIT 4
453 # define OSSL_FUNC_SIGNATURE_VERIFY 5
454 # define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT 6
455 # define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER 7
456 # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8
457 # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9
458 # define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10
459 # define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 11
460 # define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 12
461 # define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 13
462 # define OSSL_FUNC_SIGNATURE_FREECTX 14
463 # define OSSL_FUNC_SIGNATURE_DUPCTX 15
464 # define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 16
465 # define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 17
466 # define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 18
467 # define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 19
468 # define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 20
469 # define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 21
470 # define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 22
471 # define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 23
473 OSSL_CORE_MAKE_FUNC(void *, OP_signature_newctx
, (void *provctx
))
474 OSSL_CORE_MAKE_FUNC(int, OP_signature_sign_init
, (void *ctx
, void *provkey
))
475 OSSL_CORE_MAKE_FUNC(int, OP_signature_sign
, (void *ctx
, unsigned char *sig
,
476 size_t *siglen
, size_t sigsize
,
477 const unsigned char *tbs
,
479 OSSL_CORE_MAKE_FUNC(int, OP_signature_verify_init
, (void *ctx
, void *provkey
))
480 OSSL_CORE_MAKE_FUNC(int, OP_signature_verify
, (void *ctx
,
481 const unsigned char *sig
,
483 const unsigned char *tbs
,
485 OSSL_CORE_MAKE_FUNC(int, OP_signature_verify_recover_init
, (void *ctx
,
487 OSSL_CORE_MAKE_FUNC(int, OP_signature_verify_recover
, (void *ctx
,
491 const unsigned char *sig
,
493 OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_init
,
494 (void *ctx
, const char *mdname
, const char *props
,
496 OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_update
,
497 (void *ctx
, const unsigned char *data
, size_t datalen
))
498 OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_final
,
499 (void *ctx
, unsigned char *sig
, size_t *siglen
,
501 OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_init
,
502 (void *ctx
, const char *mdname
, const char *props
,
504 OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_update
,
505 (void *ctx
, const unsigned char *data
, size_t datalen
))
506 OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_final
,
507 (void *ctx
, const unsigned char *sig
, size_t siglen
))
508 OSSL_CORE_MAKE_FUNC(void, OP_signature_freectx
, (void *ctx
))
509 OSSL_CORE_MAKE_FUNC(void *, OP_signature_dupctx
, (void *ctx
))
510 OSSL_CORE_MAKE_FUNC(int, OP_signature_get_ctx_params
,
511 (void *ctx
, OSSL_PARAM params
[]))
512 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_signature_gettable_ctx_params
,
514 OSSL_CORE_MAKE_FUNC(int, OP_signature_set_ctx_params
,
515 (void *ctx
, const OSSL_PARAM params
[]))
516 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_signature_settable_ctx_params
,
518 OSSL_CORE_MAKE_FUNC(int, OP_signature_get_ctx_md_params
,
519 (void *ctx
, OSSL_PARAM params
[]))
520 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_signature_gettable_ctx_md_params
,
522 OSSL_CORE_MAKE_FUNC(int, OP_signature_set_ctx_md_params
,
523 (void *ctx
, const OSSL_PARAM params
[]))
524 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_signature_settable_ctx_md_params
,
528 /* Asymmetric Ciphers */
530 # define OSSL_FUNC_ASYM_CIPHER_NEWCTX 1
531 # define OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT 2
532 # define OSSL_FUNC_ASYM_CIPHER_ENCRYPT 3
533 # define OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT 4
534 # define OSSL_FUNC_ASYM_CIPHER_DECRYPT 5
535 # define OSSL_FUNC_ASYM_CIPHER_FREECTX 6
536 # define OSSL_FUNC_ASYM_CIPHER_DUPCTX 7
537 # define OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS 8
538 # define OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS 9
539 # define OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS 10
540 # define OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS 11
542 OSSL_CORE_MAKE_FUNC(void *, OP_asym_cipher_newctx
, (void *provctx
))
543 OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_encrypt_init
, (void *ctx
, void *provkey
))
544 OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_encrypt
, (void *ctx
, unsigned char *out
,
547 const unsigned char *in
,
549 OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_decrypt_init
, (void *ctx
, void *provkey
))
550 OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_decrypt
, (void *ctx
, unsigned char *out
,
553 const unsigned char *in
,
555 OSSL_CORE_MAKE_FUNC(void, OP_asym_cipher_freectx
, (void *ctx
))
556 OSSL_CORE_MAKE_FUNC(void *, OP_asym_cipher_dupctx
, (void *ctx
))
557 OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_get_ctx_params
,
558 (void *ctx
, OSSL_PARAM params
[]))
559 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_asym_cipher_gettable_ctx_params
,
561 OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_set_ctx_params
,
562 (void *ctx
, const OSSL_PARAM params
[]))
563 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_asym_cipher_settable_ctx_params
,
567 # define OSSL_FUNC_SERIALIZER_NEWCTX 1
568 # define OSSL_FUNC_SERIALIZER_FREECTX 2
569 # define OSSL_FUNC_SERIALIZER_SET_CTX_PARAMS 3
570 # define OSSL_FUNC_SERIALIZER_SETTABLE_CTX_PARAMS 4
571 # define OSSL_FUNC_SERIALIZER_SERIALIZE_DATA 10
572 # define OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT 11
573 OSSL_CORE_MAKE_FUNC(void *, OP_serializer_newctx
, (void *provctx
))
574 OSSL_CORE_MAKE_FUNC(void, OP_serializer_freectx
, (void *ctx
))
575 OSSL_CORE_MAKE_FUNC(int, OP_serializer_set_ctx_params
,
576 (void *ctx
, const OSSL_PARAM params
[]))
577 OSSL_CORE_MAKE_FUNC(const OSSL_PARAM
*, OP_serializer_settable_ctx_params
,
580 OSSL_CORE_MAKE_FUNC(int, OP_serializer_serialize_data
,
581 (void *ctx
, const OSSL_PARAM
[], BIO
*out
,
582 OSSL_PASSPHRASE_CALLBACK
*cb
, void *cbarg
))
583 OSSL_CORE_MAKE_FUNC(int, OP_serializer_serialize_object
,
584 (void *ctx
, void *obj
, BIO
*out
,
585 OSSL_PASSPHRASE_CALLBACK
*cb
, void *cbarg
))