]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/openssl/core_dispatch.h
EVP KEYMGMT utils: Make a few more utility functions available
[thirdparty/openssl.git] / include / openssl / core_dispatch.h
CommitLineData
4c2883a9 1/*
33388b44 2 * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
4c2883a9
RL
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
ae4186b0
DMSP
10#ifndef OPENSSL_CORE_NUMBERS_H
11# define OPENSSL_CORE_NUMBERS_H
4c2883a9 12
3593266d 13# include <stdarg.h>
4c2883a9
RL
14# include <openssl/core.h>
15
16# ifdef __cplusplus
17extern "C" {
18# endif
19
20/*-
21 * Identities
22 * ----------
23 *
24 * All series start with 1, to allow 0 to be an array terminator.
25 * For any FUNC identity, we also provide a function signature typedef
26 * and a static inline function to extract a function pointer from a
27 * OSSL_DISPATCH element in a type safe manner.
28 *
29 * Names:
30 * for any function base name 'foo' (uppercase form 'FOO'), we will have
31 * the following:
79c44b4e 32 * - a macro for the identity with the name OSSL_FUNC_'FOO' or derivatives
4c2883a9 33 * thereof (to be specified further down)
363b1e5d
DMSP
34 * - a function signature typedef with the name OSSL_FUNC_'foo'_fn
35 * - a function pointer extractor function with the name OSSL_FUNC_'foo'
4c2883a9
RL
36 */
37
b60cba3c
RS
38/*
39 * Helper macro to create the function signature typedef and the extractor
40 * |type| is the return-type of the function, |name| is the name of the
41 * function to fetch, and |args| is a parenthesized list of parameters
42 * for the function (that is, it is |name|'s function signature).
43 */
4c2883a9 44#define OSSL_CORE_MAKE_FUNC(type,name,args) \
363b1e5d 45 typedef type (OSSL_FUNC_##name##_fn)args; \
4c2883a9 46 static ossl_inline \
363b1e5d 47 OSSL_FUNC_##name##_fn *OSSL_FUNC_##name(const OSSL_DISPATCH *opf) \
4c2883a9 48 { \
363b1e5d 49 return (OSSL_FUNC_##name##_fn *)opf->function; \
4c2883a9
RL
50 }
51
52/*
53 * Core function identities, for the two OSSL_DISPATCH tables being passed
54 * in the OSSL_provider_init call.
55 *
56 * 0 serves as a marker for the end of the OSSL_DISPATCH array, and must
57 * therefore NEVER be used as a function identity.
58 */
59/* Functions provided by the Core to the provider, reserved numbers 1-1023 */
dca97d00 60# define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
26175013 61OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
d40b42ab 62 core_gettable_params,(const OSSL_CORE_HANDLE *prov))
4c2883a9 63# define OSSL_FUNC_CORE_GET_PARAMS 2
d40b42ab 64OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_CORE_HANDLE *prov,
4e7991b4 65 OSSL_PARAM params[]))
da747958 66# define OSSL_FUNC_CORE_THREAD_START 3
d40b42ab 67OSSL_CORE_MAKE_FUNC(int,core_thread_start,(const OSSL_CORE_HANDLE *prov,
da747958 68 OSSL_thread_stop_handler_fn handfn))
49c64346 69# define OSSL_FUNC_CORE_GET_LIBRARY_CONTEXT 4
d40b42ab
MC
70OSSL_CORE_MAKE_FUNC(OPENSSL_CORE_CTX *,core_get_library_context,
71 (const OSSL_CORE_HANDLE *prov))
49c64346 72# define OSSL_FUNC_CORE_NEW_ERROR 5
d40b42ab 73OSSL_CORE_MAKE_FUNC(void,core_new_error,(const OSSL_CORE_HANDLE *prov))
49c64346
RL
74# define OSSL_FUNC_CORE_SET_ERROR_DEBUG 6
75OSSL_CORE_MAKE_FUNC(void,core_set_error_debug,
d40b42ab 76 (const OSSL_CORE_HANDLE *prov,
49c64346
RL
77 const char *file, int line, const char *func))
78# define OSSL_FUNC_CORE_VSET_ERROR 7
79OSSL_CORE_MAKE_FUNC(void,core_vset_error,
d40b42ab 80 (const OSSL_CORE_HANDLE *prov,
49c64346 81 uint32_t reason, const char *fmt, va_list args))
7b131de2 82# define OSSL_FUNC_CORE_SET_ERROR_MARK 8
d40b42ab 83OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_CORE_HANDLE *prov))
7b131de2
RL
84# define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9
85OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark,
d40b42ab 86 (const OSSL_CORE_HANDLE *prov))
d16d0b71 87# define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10
d40b42ab 88OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_CORE_HANDLE *prov))
4c2883a9 89
b60cba3c 90/* Memory allocation, freeing, clearing. */
7b131de2 91#define OSSL_FUNC_CRYPTO_MALLOC 20
b60cba3c
RS
92OSSL_CORE_MAKE_FUNC(void *,
93 CRYPTO_malloc, (size_t num, const char *file, int line))
7b131de2 94#define OSSL_FUNC_CRYPTO_ZALLOC 21
b60cba3c
RS
95OSSL_CORE_MAKE_FUNC(void *,
96 CRYPTO_zalloc, (size_t num, const char *file, int line))
7b131de2 97#define OSSL_FUNC_CRYPTO_FREE 22
b60cba3c
RS
98OSSL_CORE_MAKE_FUNC(void,
99 CRYPTO_free, (void *ptr, const char *file, int line))
7b131de2 100#define OSSL_FUNC_CRYPTO_CLEAR_FREE 23
b60cba3c
RS
101OSSL_CORE_MAKE_FUNC(void,
102 CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line))
7b131de2 103#define OSSL_FUNC_CRYPTO_REALLOC 24
b60cba3c
RS
104OSSL_CORE_MAKE_FUNC(void *,
105 CRYPTO_realloc, (void *addr, size_t num, const char *file, int line))
7b131de2 106#define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 25
b60cba3c 107OSSL_CORE_MAKE_FUNC(void *,
784883fc
SL
108 CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num,
109 const char *file, int line))
7b131de2 110#define OSSL_FUNC_CRYPTO_SECURE_MALLOC 26
b60cba3c
RS
111OSSL_CORE_MAKE_FUNC(void *,
112 CRYPTO_secure_malloc, (size_t num, const char *file, int line))
7b131de2 113#define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 27
b60cba3c
RS
114OSSL_CORE_MAKE_FUNC(void *,
115 CRYPTO_secure_zalloc, (size_t num, const char *file, int line))
7b131de2 116#define OSSL_FUNC_CRYPTO_SECURE_FREE 28
b60cba3c
RS
117OSSL_CORE_MAKE_FUNC(void,
118 CRYPTO_secure_free, (void *ptr, const char *file, int line))
7b131de2 119#define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 29
b60cba3c 120OSSL_CORE_MAKE_FUNC(void,
784883fc
SL
121 CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file,
122 int line))
7b131de2 123#define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 30
b60cba3c
RS
124OSSL_CORE_MAKE_FUNC(int,
125 CRYPTO_secure_allocated, (const void *ptr))
7b131de2 126#define OSSL_FUNC_OPENSSL_CLEANSE 31
b60cba3c
RS
127OSSL_CORE_MAKE_FUNC(void,
128 OPENSSL_cleanse, (void *ptr, size_t len))
b60cba3c 129
25e60144 130/* Bio functions provided by the core */
7b131de2
RL
131#define OSSL_FUNC_BIO_NEW_FILE 40
132#define OSSL_FUNC_BIO_NEW_MEMBUF 41
133#define OSSL_FUNC_BIO_READ_EX 42
d40b42ab
MC
134#define OSSL_FUNC_BIO_WRITE_EX 43
135#define OSSL_FUNC_BIO_FREE 44
136#define OSSL_FUNC_BIO_VPRINTF 45
137#define OSSL_FUNC_BIO_VSNPRINTF 46
138
139OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_file, (const char *filename,
140 const char *mode))
141OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_membuf, (const void *buf, int len))
142OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO *bio, void *data,
143 size_t data_len, size_t *bytes_read))
144OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO *bio, const void *data,
145 size_t data_len, size_t *written))
146OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO *bio))
147OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO *bio, const char *format,
63665fff 148 va_list args))
d16d0b71
SL
149OSSL_CORE_MAKE_FUNC(int, BIO_vsnprintf,
150 (char *buf, size_t n, const char *fmt, va_list args))
25e60144 151
7b131de2 152#define OSSL_FUNC_SELF_TEST_CB 100
d40b42ab 153OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX *ctx, OSSL_CALLBACK **cb,
36fc5fc6
SL
154 void **cbarg))
155
4c2883a9 156/* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
72bfc958 157# define OSSL_FUNC_PROVIDER_TEARDOWN 1024
a39eb840 158OSSL_CORE_MAKE_FUNC(void,provider_teardown,(void *provctx))
72bfc958 159# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025
26175013 160OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
dca97d00 161 provider_gettable_params,(void *provctx))
72bfc958 162# define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
a39eb840 163OSSL_CORE_MAKE_FUNC(int,provider_get_params,(void *provctx,
4e7991b4 164 OSSL_PARAM params[]))
72bfc958 165# define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
099bd339 166OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM *,provider_query_operation,
b0f3c594 167 (void *provctx, int operation_id, int *no_store))
6ebc2f56
RL
168# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1028
169OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings,
170 (void *provctx))
72bfc958
MC
171# define OSSL_FUNC_PROVIDER_GET_CAPABILITIES 1029
172OSSL_CORE_MAKE_FUNC(int, provider_get_capabilities, (void *provctx,
173 const char *capability, OSSL_CALLBACK *cb, void *arg))
4c2883a9 174
784883fc 175/* Operations */
3653d0c2 176
2893111f 177# define OSSL_OP_DIGEST 1
784883fc
SL
178# define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
179# define OSSL_OP_MAC 3
ad1700c7 180# define OSSL_OP_KDF 4
15dfa092 181# define OSSL_OP_RAND 5
784883fc
SL
182# define OSSL_OP_KEYMGMT 10
183# define OSSL_OP_KEYEXCH 11
dfcb5d29 184# define OSSL_OP_SIGNATURE 12
2c938e2e 185# define OSSL_OP_ASYM_CIPHER 13
0d003c52
RL
186/* New section for non-EVP operations */
187# define OSSL_OP_SERIALIZER 20
784883fc 188/* Highest known operation number */
0d003c52 189# define OSSL_OP__HIGHEST 20
784883fc
SL
190
191/* Digests */
2893111f
RL
192
193# define OSSL_FUNC_DIGEST_NEWCTX 1
194# define OSSL_FUNC_DIGEST_INIT 2
195# define OSSL_FUNC_DIGEST_UPDATE 3
196# define OSSL_FUNC_DIGEST_FINAL 4
197# define OSSL_FUNC_DIGEST_DIGEST 5
198# define OSSL_FUNC_DIGEST_FREECTX 6
199# define OSSL_FUNC_DIGEST_DUPCTX 7
200# define OSSL_FUNC_DIGEST_GET_PARAMS 8
92d9d0ae
RL
201# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9
202# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10
ae3ff60e
RL
203# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
204# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
205# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
df05f2ce 206
363b1e5d
DMSP
207OSSL_CORE_MAKE_FUNC(void *, digest_newctx, (void *provctx))
208OSSL_CORE_MAKE_FUNC(int, digest_init, (void *dctx))
209OSSL_CORE_MAKE_FUNC(int, digest_update,
a39eb840 210 (void *dctx, const unsigned char *in, size_t inl))
363b1e5d 211OSSL_CORE_MAKE_FUNC(int, digest_final,
a39eb840
RL
212 (void *dctx,
213 unsigned char *out, size_t *outl, size_t outsz))
363b1e5d 214OSSL_CORE_MAKE_FUNC(int, digest_digest,
a39eb840 215 (void *provctx, const unsigned char *in, size_t inl,
8ccf2ffb 216 unsigned char *out, size_t *outl, size_t outsz))
df05f2ce 217
363b1e5d
DMSP
218OSSL_CORE_MAKE_FUNC(void, digest_freectx, (void *dctx))
219OSSL_CORE_MAKE_FUNC(void *, digest_dupctx, (void *dctx))
d5e5e2ff 220
363b1e5d
DMSP
221OSSL_CORE_MAKE_FUNC(int, digest_get_params, (OSSL_PARAM params[]))
222OSSL_CORE_MAKE_FUNC(int, digest_set_ctx_params,
2893111f 223 (void *vctx, const OSSL_PARAM params[]))
363b1e5d 224OSSL_CORE_MAKE_FUNC(int, digest_get_ctx_params,
2893111f 225 (void *vctx, OSSL_PARAM params[]))
363b1e5d
DMSP
226OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_params, (void))
227OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_settable_ctx_params, (void))
228OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, digest_gettable_ctx_params, (void))
df05f2ce
MC
229
230/* Symmetric Ciphers */
231
df05f2ce
MC
232# define OSSL_FUNC_CIPHER_NEWCTX 1
233# define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2
234# define OSSL_FUNC_CIPHER_DECRYPT_INIT 3
235# define OSSL_FUNC_CIPHER_UPDATE 4
236# define OSSL_FUNC_CIPHER_FINAL 5
718b133a
MC
237# define OSSL_FUNC_CIPHER_CIPHER 6
238# define OSSL_FUNC_CIPHER_FREECTX 7
239# define OSSL_FUNC_CIPHER_DUPCTX 8
80942379 240# define OSSL_FUNC_CIPHER_GET_PARAMS 9
92d9d0ae
RL
241# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10
242# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11
ae3ff60e
RL
243# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
244# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
245# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
df05f2ce 246
363b1e5d
DMSP
247OSSL_CORE_MAKE_FUNC(void *, cipher_newctx, (void *provctx))
248OSSL_CORE_MAKE_FUNC(int, cipher_encrypt_init, (void *cctx,
df05f2ce 249 const unsigned char *key,
344cfa34
MC
250 size_t keylen,
251 const unsigned char *iv,
252 size_t ivlen))
363b1e5d 253OSSL_CORE_MAKE_FUNC(int, cipher_decrypt_init, (void *cctx,
df05f2ce 254 const unsigned char *key,
344cfa34
MC
255 size_t keylen,
256 const unsigned char *iv,
257 size_t ivlen))
363b1e5d 258OSSL_CORE_MAKE_FUNC(int, cipher_update,
a39eb840
RL
259 (void *cctx,
260 unsigned char *out, size_t *outl, size_t outsize,
df05f2ce 261 const unsigned char *in, size_t inl))
363b1e5d 262OSSL_CORE_MAKE_FUNC(int, cipher_final,
a39eb840
RL
263 (void *cctx,
264 unsigned char *out, size_t *outl, size_t outsize))
363b1e5d 265OSSL_CORE_MAKE_FUNC(int, cipher_cipher,
a39eb840 266 (void *cctx,
f79858ac
RL
267 unsigned char *out, size_t *outl, size_t outsize,
268 const unsigned char *in, size_t inl))
363b1e5d
DMSP
269OSSL_CORE_MAKE_FUNC(void, cipher_freectx, (void *cctx))
270OSSL_CORE_MAKE_FUNC(void *, cipher_dupctx, (void *cctx))
271OSSL_CORE_MAKE_FUNC(int, cipher_get_params, (OSSL_PARAM params[]))
272OSSL_CORE_MAKE_FUNC(int, cipher_get_ctx_params, (void *cctx,
4e7991b4 273 OSSL_PARAM params[]))
363b1e5d 274OSSL_CORE_MAKE_FUNC(int, cipher_set_ctx_params, (void *cctx,
718b133a 275 const OSSL_PARAM params[]))
363b1e5d
DMSP
276OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_params, (void))
277OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_settable_ctx_params, (void))
278OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_ctx_params, (void))
df05f2ce 279
e74bd290
RL
280/* MACs */
281
e74bd290
RL
282# define OSSL_FUNC_MAC_NEWCTX 1
283# define OSSL_FUNC_MAC_DUPCTX 2
284# define OSSL_FUNC_MAC_FREECTX 3
285# define OSSL_FUNC_MAC_INIT 4
286# define OSSL_FUNC_MAC_UPDATE 5
287# define OSSL_FUNC_MAC_FINAL 6
784883fc
SL
288# define OSSL_FUNC_MAC_GET_PARAMS 7
289# define OSSL_FUNC_MAC_GET_CTX_PARAMS 8
290# define OSSL_FUNC_MAC_SET_CTX_PARAMS 9
291# define OSSL_FUNC_MAC_GETTABLE_PARAMS 10
292# define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS 11
293# define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS 12
e74bd290 294
363b1e5d
DMSP
295OSSL_CORE_MAKE_FUNC(void *, mac_newctx, (void *provctx))
296OSSL_CORE_MAKE_FUNC(void *, mac_dupctx, (void *src))
297OSSL_CORE_MAKE_FUNC(void, mac_freectx, (void *mctx))
298OSSL_CORE_MAKE_FUNC(size_t, mac_size, (void *mctx))
299OSSL_CORE_MAKE_FUNC(int, mac_init, (void *mctx))
300OSSL_CORE_MAKE_FUNC(int, mac_update,
e74bd290 301 (void *mctx, const unsigned char *in, size_t inl))
363b1e5d 302OSSL_CORE_MAKE_FUNC(int, mac_final,
e74bd290
RL
303 (void *mctx,
304 unsigned char *out, size_t *outl, size_t outsize))
363b1e5d
DMSP
305OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_params, (void))
306OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_gettable_ctx_params, (void))
307OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, mac_settable_ctx_params, (void))
308OSSL_CORE_MAKE_FUNC(int, mac_get_params, (OSSL_PARAM params[]))
309OSSL_CORE_MAKE_FUNC(int, mac_get_ctx_params,
e74bd290 310 (void *mctx, OSSL_PARAM params[]))
363b1e5d 311OSSL_CORE_MAKE_FUNC(int, mac_set_ctx_params,
e74bd290
RL
312 (void *mctx, const OSSL_PARAM params[]))
313
2f755701 314/* KDFs and PRFs */
2f755701
P
315
316# define OSSL_FUNC_KDF_NEWCTX 1
317# define OSSL_FUNC_KDF_DUPCTX 2
318# define OSSL_FUNC_KDF_FREECTX 3
319# define OSSL_FUNC_KDF_RESET 4
320# define OSSL_FUNC_KDF_DERIVE 5
321# define OSSL_FUNC_KDF_GETTABLE_PARAMS 6
322# define OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 7
323# define OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 8
324# define OSSL_FUNC_KDF_GET_PARAMS 9
325# define OSSL_FUNC_KDF_GET_CTX_PARAMS 10
326# define OSSL_FUNC_KDF_SET_CTX_PARAMS 11
327
363b1e5d
DMSP
328OSSL_CORE_MAKE_FUNC(void *, kdf_newctx, (void *provctx))
329OSSL_CORE_MAKE_FUNC(void *, kdf_dupctx, (void *src))
330OSSL_CORE_MAKE_FUNC(void, kdf_freectx, (void *kctx))
331OSSL_CORE_MAKE_FUNC(void, kdf_reset, (void *kctx))
332OSSL_CORE_MAKE_FUNC(int, kdf_derive, (void *kctx, unsigned char *key,
2f755701 333 size_t keylen))
363b1e5d
DMSP
334OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_params, (void))
335OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_gettable_ctx_params, (void))
336OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, kdf_settable_ctx_params, (void))
337OSSL_CORE_MAKE_FUNC(int, kdf_get_params, (OSSL_PARAM params[]))
338OSSL_CORE_MAKE_FUNC(int, kdf_get_ctx_params,
2f755701 339 (void *kctx, OSSL_PARAM params[]))
363b1e5d 340OSSL_CORE_MAKE_FUNC(int, kdf_set_ctx_params,
2f755701
P
341 (void *kctx, const OSSL_PARAM params[]))
342
15dfa092
P
343/* RAND */
344
345# define OSSL_FUNC_RAND_NEWCTX 1
346# define OSSL_FUNC_RAND_FREECTX 2
347# define OSSL_FUNC_RAND_INSTANTIATE 3
348# define OSSL_FUNC_RAND_UNINSTANTIATE 4
349# define OSSL_FUNC_RAND_GENERATE 5
350# define OSSL_FUNC_RAND_RESEED 6
351# define OSSL_FUNC_RAND_NONCE 7
352# define OSSL_FUNC_RAND_ENABLE_LOCKING 8
353# define OSSL_FUNC_RAND_LOCK 9
354# define OSSL_FUNC_RAND_UNLOCK 10
355# define OSSL_FUNC_RAND_GETTABLE_PARAMS 11
356# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS 12
357# define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS 13
358# define OSSL_FUNC_RAND_GET_PARAMS 14
359# define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
360# define OSSL_FUNC_RAND_SET_CTX_PARAMS 16
361# define OSSL_FUNC_RAND_SET_CALLBACKS 17
714a1bb3 362# define OSSL_FUNC_RAND_VERIFY_ZEROIZATION 18
15dfa092 363
363b1e5d 364OSSL_CORE_MAKE_FUNC(void *,rand_newctx,
f000e828 365 (void *provctx, void *parent,
15dfa092 366 const OSSL_DISPATCH *parent_calls))
363b1e5d
DMSP
367OSSL_CORE_MAKE_FUNC(void,rand_freectx, (void *vctx))
368OSSL_CORE_MAKE_FUNC(int,rand_instantiate,
714a1bb3
P
369 (void *vdrbg, unsigned int strength,
370 int prediction_resistance,
15dfa092 371 const unsigned char *pstr, size_t pstr_len))
363b1e5d
DMSP
372OSSL_CORE_MAKE_FUNC(int,rand_uninstantiate, (void *vdrbg))
373OSSL_CORE_MAKE_FUNC(int,rand_generate,
15dfa092 374 (void *vctx, unsigned char *out, size_t outlen,
714a1bb3 375 unsigned int strength, int prediction_resistance,
15dfa092 376 const unsigned char *addin, size_t addin_len))
363b1e5d 377OSSL_CORE_MAKE_FUNC(int,rand_reseed,
15dfa092 378 (void *vctx, int prediction_resistance,
714a1bb3 379 const unsigned char *ent, size_t ent_len,
15dfa092 380 const unsigned char *addin, size_t addin_len))
363b1e5d 381OSSL_CORE_MAKE_FUNC(size_t,rand_nonce,
f000e828 382 (void *vctx, unsigned char *out, unsigned int strength,
714a1bb3 383 size_t min_noncelen, size_t max_noncelen))
363b1e5d
DMSP
384OSSL_CORE_MAKE_FUNC(int,rand_enable_locking, (void *vctx))
385OSSL_CORE_MAKE_FUNC(int,rand_lock, (void *vctx))
386OSSL_CORE_MAKE_FUNC(void,rand_unlock, (void *vctx))
387OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_gettable_params, (void))
388OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_gettable_ctx_params, (void))
389OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,rand_settable_ctx_params, (void))
390OSSL_CORE_MAKE_FUNC(int,rand_get_params, (OSSL_PARAM params[]))
391OSSL_CORE_MAKE_FUNC(int,rand_get_ctx_params,
15dfa092 392 (void *vctx, OSSL_PARAM params[]))
363b1e5d 393OSSL_CORE_MAKE_FUNC(int,rand_set_ctx_params,
15dfa092 394 (void *vctx, const OSSL_PARAM params[]))
363b1e5d 395OSSL_CORE_MAKE_FUNC(void,rand_set_callbacks,
f000e828
P
396 (void *vctx, OSSL_INOUT_CALLBACK *get_entropy,
397 OSSL_CALLBACK *cleanup_entropy,
398 OSSL_INOUT_CALLBACK *get_nonce,
399 OSSL_CALLBACK *cleanup_nonce, void *arg))
363b1e5d 400OSSL_CORE_MAKE_FUNC(int,rand_verify_zeroization,
714a1bb3 401 (void *vctx))
15dfa092 402
a94a3e0d
RL
403/*-
404 * Key management
405 *
b305452f
RL
406 * The Key Management takes care of provider side key objects, and includes
407 * all current functionality to create them, destroy them, set parameters
408 * and key material, etc, essentially everything that manipulates the keys
409 * themselves and their parameters.
a94a3e0d 410 *
b305452f
RL
411 * The key objects are commonly refered to as |keydata|, and it MUST be able
412 * to contain parameters if the key has any, the public key and the private
413 * key. All parts are optional, but their presence determines what can be
414 * done with the key object in terms of encryption, signature, and so on.
415 * The assumption from libcrypto is that the key object contains any of the
416 * following data combinations:
417 *
418 * - parameters only
419 * - public key only
420 * - public key + private key
421 * - parameters + public key
422 * - parameters + public key + private key
423 *
424 * What "parameters", "public key" and "private key" means in detail is left
425 * to the implementation. In the case of DH and DSA, they would typically
426 * include domain parameters, while for certain variants of RSA, they would
427 * typically include PSS or OAEP parameters.
428 *
363b1e5d
DMSP
429 * Key objects are created with OSSL_FUNC_keymgmt_new() and destroyed with
430 * OSSL_FUNC_keymgmt_free(). Key objects can have data filled in with
431 * OSSL_FUNC_keymgmt_import().
b305452f
RL
432 *
433 * Three functions are made available to check what selection of data is
363b1e5d
DMSP
434 * present in a key object: OSSL_FUNC_keymgmt_has_parameters(),
435 * OSSL_FUNC_keymgmt_has_public_key(), and OSSL_FUNC_keymgmt_has_private_key(),
a94a3e0d
RL
436 */
437
b305452f
RL
438/* Key data subset selection - individual bits */
439# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
440# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
441# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
442# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
443
444/* Key data subset selection - combinations */
445# define OSSL_KEYMGMT_SELECT_ALL_PARAMETERS \
446 ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
447 | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
448# define OSSL_KEYMGMT_SELECT_KEYPAIR \
449 ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
450# define OSSL_KEYMGMT_SELECT_ALL \
451 ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
452
1a5632e0 453/* Basic key object creation */
b305452f 454# define OSSL_FUNC_KEYMGMT_NEW 1
363b1e5d 455OSSL_CORE_MAKE_FUNC(void *, keymgmt_new, (void *provctx))
1a5632e0
RL
456
457/* Generation, a more complex constructor */
2b9add69
RL
458# define OSSL_FUNC_KEYMGMT_GEN_INIT 2
459# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE 3
460# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS 4
461# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS 5
5e77b79a
SL
462# define OSSL_FUNC_KEYMGMT_GEN 6
463# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 7
363b1e5d 464OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen_init,
1a5632e0 465 (void *provctx, int selection))
363b1e5d 466OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_template,
1a5632e0 467 (void *genctx, void *templ))
363b1e5d 468OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_set_params,
1a5632e0
RL
469 (void *genctx, const OSSL_PARAM params[]))
470OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
363b1e5d
DMSP
471 keymgmt_gen_settable_params, (void *provctx))
472OSSL_CORE_MAKE_FUNC(int, keymgmt_gen_get_params,
2b9add69
RL
473 (void *genctx, OSSL_PARAM params[]))
474OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
363b1e5d
DMSP
475 keymgmt_gen_gettable_params, (void *provctx))
476OSSL_CORE_MAKE_FUNC(void *, keymgmt_gen,
1a5632e0 477 (void *genctx, OSSL_CALLBACK *cb, void *cbarg))
363b1e5d 478OSSL_CORE_MAKE_FUNC(void, keymgmt_gen_cleanup, (void *genctx))
1a5632e0
RL
479
480/* Basic key object destruction */
2b9add69 481# define OSSL_FUNC_KEYMGMT_FREE 10
363b1e5d 482OSSL_CORE_MAKE_FUNC(void, keymgmt_free, (void *keydata))
b305452f
RL
483
484/* Key object information, with discovery */
2b9add69
RL
485#define OSSL_FUNC_KEYMGMT_GET_PARAMS 11
486#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS 12
363b1e5d 487OSSL_CORE_MAKE_FUNC(int, keymgmt_get_params,
b305452f 488 (void *keydata, OSSL_PARAM params[]))
363b1e5d 489OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_gettable_params, (void))
b305452f 490
2b9add69
RL
491#define OSSL_FUNC_KEYMGMT_SET_PARAMS 13
492#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS 14
363b1e5d 493OSSL_CORE_MAKE_FUNC(int, keymgmt_set_params,
4fe54d67 494 (void *keydata, const OSSL_PARAM params[]))
363b1e5d 495OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_settable_params, (void))
4fe54d67 496
b305452f
RL
497/* Key checks - discovery of supported operations */
498# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20
363b1e5d 499OSSL_CORE_MAKE_FUNC(const char *, keymgmt_query_operation_name,
e62a45b6
RL
500 (int operation_id))
501
b305452f
RL
502/* Key checks - key data content checks */
503# define OSSL_FUNC_KEYMGMT_HAS 21
363b1e5d 504OSSL_CORE_MAKE_FUNC(int, keymgmt_has, (void *keydata, int selection))
b305452f
RL
505
506/* Key checks - validation */
507# define OSSL_FUNC_KEYMGMT_VALIDATE 22
363b1e5d 508OSSL_CORE_MAKE_FUNC(int, keymgmt_validate, (void *keydata, int selection))
b305452f 509
bee5d6cd
RL
510/* Key checks - matching */
511# define OSSL_FUNC_KEYMGMT_MATCH 23
363b1e5d 512OSSL_CORE_MAKE_FUNC(int, keymgmt_match,
bee5d6cd
RL
513 (const void *keydata1, const void *keydata2,
514 int selection))
515
13697f1c 516/* Import and export functions, with discovery */
b305452f
RL
517# define OSSL_FUNC_KEYMGMT_IMPORT 40
518# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41
519# define OSSL_FUNC_KEYMGMT_EXPORT 42
520# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES 43
363b1e5d 521OSSL_CORE_MAKE_FUNC(int, keymgmt_import,
b305452f 522 (void *keydata, int selection, const OSSL_PARAM params[]))
363b1e5d 523OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_import_types,
b305452f 524 (int selection))
363b1e5d 525OSSL_CORE_MAKE_FUNC(int, keymgmt_export,
b305452f
RL
526 (void *keydata, int selection,
527 OSSL_CALLBACK *param_cb, void *cbarg))
363b1e5d 528OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keymgmt_export_types,
b305452f 529 (int selection))
12603de6 530
13697f1c
RL
531/* Copy function, only works for matching keymgmt */
532# define OSSL_FUNC_KEYMGMT_COPY 44
363b1e5d 533OSSL_CORE_MAKE_FUNC(int, keymgmt_copy,
13697f1c
RL
534 ( void *keydata_to, const void *keydata_from,
535 int selection))
536
ff64702b
MC
537/* Key Exchange */
538
ff64702b
MC
539# define OSSL_FUNC_KEYEXCH_NEWCTX 1
540# define OSSL_FUNC_KEYEXCH_INIT 2
541# define OSSL_FUNC_KEYEXCH_DERIVE 3
542# define OSSL_FUNC_KEYEXCH_SET_PEER 4
543# define OSSL_FUNC_KEYEXCH_FREECTX 5
544# define OSSL_FUNC_KEYEXCH_DUPCTX 6
9c45222d
MC
545# define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS 7
546# define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8
4fe54d67
NT
547# define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS 9
548# define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS 10
ff64702b 549
363b1e5d
DMSP
550OSSL_CORE_MAKE_FUNC(void *, keyexch_newctx, (void *provctx))
551OSSL_CORE_MAKE_FUNC(int, keyexch_init, (void *ctx, void *provkey))
552OSSL_CORE_MAKE_FUNC(int, keyexch_derive, (void *ctx, unsigned char *secret,
59972370 553 size_t *secretlen, size_t outlen))
363b1e5d
DMSP
554OSSL_CORE_MAKE_FUNC(int, keyexch_set_peer, (void *ctx, void *provkey))
555OSSL_CORE_MAKE_FUNC(void, keyexch_freectx, (void *ctx))
556OSSL_CORE_MAKE_FUNC(void *, keyexch_dupctx, (void *ctx))
557OSSL_CORE_MAKE_FUNC(int, keyexch_set_ctx_params, (void *ctx,
9c45222d 558 const OSSL_PARAM params[]))
363b1e5d 559OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_settable_ctx_params,
9c45222d 560 (void))
363b1e5d 561OSSL_CORE_MAKE_FUNC(int, keyexch_get_ctx_params, (void *ctx,
4fe54d67 562 OSSL_PARAM params[]))
363b1e5d 563OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, keyexch_gettable_ctx_params,
4fe54d67 564 (void))
ff64702b 565
dfcb5d29
MC
566/* Signature */
567
568# define OSSL_FUNC_SIGNATURE_NEWCTX 1
569# define OSSL_FUNC_SIGNATURE_SIGN_INIT 2
570# define OSSL_FUNC_SIGNATURE_SIGN 3
390acbeb
MC
571# define OSSL_FUNC_SIGNATURE_VERIFY_INIT 4
572# define OSSL_FUNC_SIGNATURE_VERIFY 5
573# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT 6
574# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER 7
d8c98d79
MC
575# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8
576# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9
577# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10
eea1e780
MC
578# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN 11
579# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 12
580# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 13
581# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 14
582# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY 15
583# define OSSL_FUNC_SIGNATURE_FREECTX 16
584# define OSSL_FUNC_SIGNATURE_DUPCTX 17
585# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 18
586# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 19
587# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 20
588# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 21
589# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 22
590# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
591# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24
592# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
dfcb5d29 593
363b1e5d 594OSSL_CORE_MAKE_FUNC(void *, signature_newctx, (void *provctx,
2c6094ba 595 const char *propq))
363b1e5d
DMSP
596OSSL_CORE_MAKE_FUNC(int, signature_sign_init, (void *ctx, void *provkey))
597OSSL_CORE_MAKE_FUNC(int, signature_sign, (void *ctx, unsigned char *sig,
dfcb5d29
MC
598 size_t *siglen, size_t sigsize,
599 const unsigned char *tbs,
600 size_t tbslen))
363b1e5d
DMSP
601OSSL_CORE_MAKE_FUNC(int, signature_verify_init, (void *ctx, void *provkey))
602OSSL_CORE_MAKE_FUNC(int, signature_verify, (void *ctx,
390acbeb
MC
603 const unsigned char *sig,
604 size_t siglen,
605 const unsigned char *tbs,
606 size_t tbslen))
363b1e5d 607OSSL_CORE_MAKE_FUNC(int, signature_verify_recover_init, (void *ctx,
390acbeb 608 void *provkey))
363b1e5d 609OSSL_CORE_MAKE_FUNC(int, signature_verify_recover, (void *ctx,
390acbeb
MC
610 unsigned char *rout,
611 size_t *routlen,
612 size_t routsize,
613 const unsigned char *sig,
614 size_t siglen))
363b1e5d 615OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_init,
2c6094ba 616 (void *ctx, const char *mdname, void *provkey))
363b1e5d 617OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_update,
d8c98d79 618 (void *ctx, const unsigned char *data, size_t datalen))
363b1e5d 619OSSL_CORE_MAKE_FUNC(int, signature_digest_sign_final,
d8c98d79
MC
620 (void *ctx, unsigned char *sig, size_t *siglen,
621 size_t sigsize))
363b1e5d 622OSSL_CORE_MAKE_FUNC(int, signature_digest_sign,
eea1e780
MC
623 (void *ctx, unsigned char *sigret, size_t *siglen,
624 size_t sigsize, const unsigned char *tbs, size_t tbslen))
363b1e5d 625OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_init,
2c6094ba 626 (void *ctx, const char *mdname, void *provkey))
363b1e5d 627OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_update,
d8c98d79 628 (void *ctx, const unsigned char *data, size_t datalen))
363b1e5d 629OSSL_CORE_MAKE_FUNC(int, signature_digest_verify_final,
d8c98d79 630 (void *ctx, const unsigned char *sig, size_t siglen))
363b1e5d 631OSSL_CORE_MAKE_FUNC(int, signature_digest_verify,
eea1e780
MC
632 (void *ctx, const unsigned char *sig, size_t siglen,
633 const unsigned char *tbs, size_t tbslen))
363b1e5d
DMSP
634OSSL_CORE_MAKE_FUNC(void, signature_freectx, (void *ctx))
635OSSL_CORE_MAKE_FUNC(void *, signature_dupctx, (void *ctx))
636OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_params,
9c45222d 637 (void *ctx, OSSL_PARAM params[]))
363b1e5d 638OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_params,
9c45222d 639 (void))
363b1e5d 640OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_params,
9c45222d 641 (void *ctx, const OSSL_PARAM params[]))
363b1e5d 642OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_params,
9c45222d 643 (void))
363b1e5d 644OSSL_CORE_MAKE_FUNC(int, signature_get_ctx_md_params,
d8c98d79 645 (void *ctx, OSSL_PARAM params[]))
363b1e5d 646OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_gettable_ctx_md_params,
d8c98d79 647 (void *ctx))
363b1e5d 648OSSL_CORE_MAKE_FUNC(int, signature_set_ctx_md_params,
d8c98d79 649 (void *ctx, const OSSL_PARAM params[]))
363b1e5d 650OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, signature_settable_ctx_md_params,
d8c98d79 651 (void *ctx))
dfcb5d29 652
2c938e2e
MC
653
654/* Asymmetric Ciphers */
655
656# define OSSL_FUNC_ASYM_CIPHER_NEWCTX 1
657# define OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT 2
658# define OSSL_FUNC_ASYM_CIPHER_ENCRYPT 3
659# define OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT 4
660# define OSSL_FUNC_ASYM_CIPHER_DECRYPT 5
661# define OSSL_FUNC_ASYM_CIPHER_FREECTX 6
662# define OSSL_FUNC_ASYM_CIPHER_DUPCTX 7
663# define OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS 8
664# define OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS 9
665# define OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS 10
666# define OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS 11
667
363b1e5d
DMSP
668OSSL_CORE_MAKE_FUNC(void *, asym_cipher_newctx, (void *provctx))
669OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt_init, (void *ctx, void *provkey))
670OSSL_CORE_MAKE_FUNC(int, asym_cipher_encrypt, (void *ctx, unsigned char *out,
2c938e2e
MC
671 size_t *outlen,
672 size_t outsize,
673 const unsigned char *in,
674 size_t inlen))
363b1e5d
DMSP
675OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt_init, (void *ctx, void *provkey))
676OSSL_CORE_MAKE_FUNC(int, asym_cipher_decrypt, (void *ctx, unsigned char *out,
2c938e2e
MC
677 size_t *outlen,
678 size_t outsize,
679 const unsigned char *in,
680 size_t inlen))
363b1e5d
DMSP
681OSSL_CORE_MAKE_FUNC(void, asym_cipher_freectx, (void *ctx))
682OSSL_CORE_MAKE_FUNC(void *, asym_cipher_dupctx, (void *ctx))
683OSSL_CORE_MAKE_FUNC(int, asym_cipher_get_ctx_params,
2c938e2e 684 (void *ctx, OSSL_PARAM params[]))
363b1e5d 685OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_gettable_ctx_params,
2c938e2e 686 (void))
363b1e5d 687OSSL_CORE_MAKE_FUNC(int, asym_cipher_set_ctx_params,
2c938e2e 688 (void *ctx, const OSSL_PARAM params[]))
363b1e5d 689OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, asym_cipher_settable_ctx_params,
2c938e2e
MC
690 (void))
691
0d003c52
RL
692/* Serializers */
693# define OSSL_FUNC_SERIALIZER_NEWCTX 1
694# define OSSL_FUNC_SERIALIZER_FREECTX 2
695# define OSSL_FUNC_SERIALIZER_SET_CTX_PARAMS 3
696# define OSSL_FUNC_SERIALIZER_SETTABLE_CTX_PARAMS 4
697# define OSSL_FUNC_SERIALIZER_SERIALIZE_DATA 10
698# define OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT 11
363b1e5d
DMSP
699OSSL_CORE_MAKE_FUNC(void *, serializer_newctx, (void *provctx))
700OSSL_CORE_MAKE_FUNC(void, serializer_freectx, (void *ctx))
701OSSL_CORE_MAKE_FUNC(int, serializer_set_ctx_params,
0d003c52 702 (void *ctx, const OSSL_PARAM params[]))
363b1e5d 703OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, serializer_settable_ctx_params,
0d003c52
RL
704 (void))
705
363b1e5d 706OSSL_CORE_MAKE_FUNC(int, serializer_serialize_data,
d40b42ab 707 (void *ctx, const OSSL_PARAM[], OSSL_CORE_BIO *out,
0d003c52 708 OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
363b1e5d 709OSSL_CORE_MAKE_FUNC(int, serializer_serialize_object,
d40b42ab 710 (void *ctx, void *obj, OSSL_CORE_BIO *out,
0d003c52
RL
711 OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
712
4c2883a9
RL
713# ifdef __cplusplus
714}
715# endif
716
717#endif