void *arg),
void *arg)
{
+ struct EVP_ASYM_CIPHER_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_ASYM_CIPHER,
- (void (*)(void *, void *))fn, arg,
+ EVP_ASYM_CIPHER_do_all_provided_thunk, &t,
evp_asym_cipher_from_algorithm,
evp_asym_cipher_up_ref,
evp_asym_cipher_free);
void (*fn)(EVP_MD *mac, void *arg),
void *arg)
{
+ struct EVP_MD_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_DIGEST,
- (void (*)(void *, void *))fn, arg,
+ EVP_MD_do_all_provided_thunk, &t,
evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
}
void (*fn)(EVP_CIPHER *mac, void *arg),
void *arg)
{
+ struct EVP_CIPHER_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_CIPHER,
- (void (*)(void *, void *))fn, arg,
+ EVP_CIPHER_do_all_provided_thunk, &t,
evp_cipher_from_algorithm, evp_cipher_up_ref,
evp_cipher_free);
}
void *data);
int evp_cipher_cache_constants(EVP_CIPHER *cipher);
+#define EVP_DO_ALL_PROVIDED_THUNK(type) \
+ struct type##_do_all_provided_thunk { \
+ void (*fn)(type * method, void *arg); \
+ void *arg; \
+ }; \
+ static ossl_inline ossl_unused void type##_do_all_provided_thunk(void *method, void *arg) \
+ { \
+ struct type##_do_all_provided_thunk *t = arg; \
+ (*t->fn)((type *)method, t->arg); \
+ }
+
+EVP_DO_ALL_PROVIDED_THUNK(EVP_ASYM_CIPHER)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_MD)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_CIPHER)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_RAND)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_KEYEXCH)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_KDF)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_KEM)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_KEYMGMT)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_MAC)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_SIGNATURE)
+EVP_DO_ALL_PROVIDED_THUNK(EVP_SKEYMGMT)
+
#endif /* !defined(OSSL_LIBCRYPTO_EVP_EVP_LOCAL_H) */
void (*fn)(EVP_RAND *rand, void *arg),
void *arg)
{
+ struct EVP_RAND_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_RAND,
- (void (*)(void *, void *))fn, arg,
+ EVP_RAND_do_all_provided_thunk, &t,
evp_rand_from_algorithm, evp_rand_up_ref,
evp_rand_free);
}
void (*fn)(EVP_KEYEXCH *keyexch, void *arg),
void *arg)
{
+ struct EVP_KEYEXCH_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_KEYEXCH,
- (void (*)(void *, void *))fn, arg,
+ EVP_KEYEXCH_do_all_provided_thunk, &t,
evp_keyexch_from_algorithm,
evp_keyexch_up_ref,
evp_keyexch_free);
void (*fn)(EVP_KDF *kdf, void *arg),
void *arg)
{
+ struct EVP_KDF_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_KDF,
- (void (*)(void *, void *))fn, arg,
+ EVP_KDF_do_all_provided_thunk, &t,
evp_kdf_from_algorithm, evp_kdf_up_ref, evp_kdf_free);
}
void (*fn)(EVP_KEM *kem, void *arg),
void *arg)
{
- evp_generic_do_all(libctx, OSSL_OP_KEM, (void (*)(void *, void *))fn, arg,
+ struct EVP_KEM_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
+ evp_generic_do_all(libctx, OSSL_OP_KEM, EVP_KEM_do_all_provided_thunk, &t,
evp_kem_from_algorithm,
evp_kem_up_ref,
evp_kem_free);
void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
void *arg)
{
+ struct EVP_KEYMGMT_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_KEYMGMT,
- (void (*)(void *, void *))fn, arg,
+ EVP_KEYMGMT_do_all_provided_thunk, &t,
keymgmt_from_algorithm,
evp_keymgmt_up_ref,
evp_keymgmt_free);
void (*fn)(EVP_MAC *mac, void *arg),
void *arg)
{
+ struct EVP_MAC_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_MAC,
- (void (*)(void *, void *))fn, arg,
+ EVP_MAC_do_all_provided_thunk, &t,
evp_mac_from_algorithm, evp_mac_up_ref, evp_mac_free);
}
void *arg),
void *arg)
{
+ struct EVP_SIGNATURE_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_SIGNATURE,
- (void (*)(void *, void *))fn, arg,
+ EVP_SIGNATURE_do_all_provided_thunk, &t,
evp_signature_from_algorithm,
evp_signature_up_ref,
evp_signature_free);
void (*fn)(EVP_SKEYMGMT *skeymgmt, void *arg),
void *arg)
{
+ struct EVP_SKEYMGMT_do_all_provided_thunk t;
+
+ t.fn = fn;
+ t.arg = arg;
evp_generic_do_all(libctx, OSSL_OP_SKEYMGMT,
- (void (*)(void *, void *))fn, arg,
+ EVP_SKEYMGMT_do_all_provided_thunk, &t,
skeymgmt_from_algorithm,
evp_skeymgmt_up_ref,
evp_skeymgmt_free);