Lines Matching refs:selection

304 int ec_has(const void *keydata, int selection)
311 if ((selection & EC_POSSIBLE_SELECTIONS) == 0)
312 return 1; /* the selection is not missing */
314 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
316 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
318 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
328 static int ec_match(const void *keydata1, const void *keydata2, int selection)
344 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
347 if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
350 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
360 && (selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
390 int common_import(void *keydata, int selection, const OSSL_PARAM params[],
412 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) == 0)
420 if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
422 selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;
426 if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
433 int ec_import(void *keydata, int selection, const OSSL_PARAM params[])
435 return common_import(keydata, selection, params, 0);
441 int sm2_import(void *keydata, int selection, const OSSL_PARAM params[])
443 return common_import(keydata, selection, params, 1);
449 int ec_export(void *keydata, int selection, OSSL_CALLBACK *param_cb,
475 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) == 0)
477 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0
478 && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)
485 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
498 if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
500 selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY ? 1 : 0;
504 if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
557 const OSSL_PARAM *ec_imexport_types(int selection)
561 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
563 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
565 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
567 if ((selection & OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS) != 0)
573 const OSSL_PARAM *ec_import_types(int selection)
575 return ec_imexport_types(selection);
579 const OSSL_PARAM *ec_export_types(int selection)
581 return ec_imexport_types(selection);
897 int sm2_validate(const void *keydata, int selection, int checktype)
906 if ((selection & EC_POSSIBLE_SELECTIONS) == 0)
913 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
916 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
923 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
926 if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == OSSL_KEYMGMT_SELECT_KEYPAIR)
936 int ec_validate(const void *keydata, int selection, int checktype)
945 if ((selection & EC_POSSIBLE_SELECTIONS) == 0)
952 if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
962 if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
969 if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
972 if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == OSSL_KEYMGMT_SELECT_KEYPAIR)
989 int selection;
994 static void *ec_gen_init(void *provctx, int selection,
1000 if (!ossl_prov_is_running() || (selection & (EC_POSSIBLE_SELECTIONS)) == 0)
1005 gctx->selection = selection;
1017 static void *sm2_gen_init(void *provctx, int selection,
1020 struct ec_gen_ctx *gctx = ec_gen_init(provctx, selection, params);
1277 if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
1332 if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0)
1400 static void *ec_dup(const void *keydata_from, int selection)
1403 return ossl_ec_key_dup(keydata_from, selection);