+/*
+ * An EVP_PKEY can have the following support states:
+ *
+ * Supports legacy implementations only:
+ *
+ * engine != NULL || keytype == NULL
+ *
+ * Supports provided implementations:
+ *
+ * engine == NULL && keytype != NULL
+ */
+#define evp_pkey_ctx_is_legacy(ctx) \
+ ((ctx)->engine != NULL || (ctx)->keytype == NULL)
+#define evp_pkey_ctx_is_provided(ctx) \
+ (!evp_pkey_ctx_is_legacy(ctx))
+