Home
last modified time | relevance | path

Searched refs:genctx (Results 1 – 25 of 27) sorted by relevance

12

/freebsd/crypto/openssl/demos/pkey/
H A DEVP_PKEY_EC_keygen.c40 EVP_PKEY_CTX *genctx = NULL; in do_ec_keygen() local
44 genctx = EVP_PKEY_CTX_new_from_name(libctx, "EC", propq); in do_ec_keygen()
45 if (genctx == NULL) { in do_ec_keygen()
50 if (EVP_PKEY_keygen_init(genctx) <= 0) { in do_ec_keygen()
64 if (!EVP_PKEY_CTX_set_params(genctx, params)) { in do_ec_keygen()
70 if (EVP_PKEY_generate(genctx, &key) <= 0) { in do_ec_keygen()
75 EVP_PKEY_CTX_free(genctx); in do_ec_keygen()
H A DEVP_PKEY_RSA_keygen.c37 EVP_PKEY_CTX *genctx = NULL; in generate_rsa_key_long() local
42 genctx = EVP_PKEY_CTX_new_from_name(libctx, "RSA", propq); in generate_rsa_key_long()
43 if (genctx == NULL) { in generate_rsa_key_long()
49 if (EVP_PKEY_keygen_init(genctx) <= 0) { in generate_rsa_key_long()
58 if (EVP_PKEY_CTX_set_rsa_keygen_bits(genctx, bits) <= 0) { in generate_rsa_key_long()
71 if (EVP_PKEY_CTX_set_rsa_keygen_primes(genctx, primes) <= 0) { in generate_rsa_key_long()
87 if (EVP_PKEY_generate(genctx, &pkey) <= 0) { in generate_rsa_key_long()
95 EVP_PKEY_CTX_free(genctx); in generate_rsa_key_long()
/freebsd/crypto/openssl/test/
H A Devp_pkey_dhkem_test.c121 EVP_PKEY_CTX *genctx = NULL; in test_ec_dhkem_derivekey_fail() local
132 if (!TEST_ptr(genctx = EVP_PKEY_CTX_new_from_name(libctx, "EC", NULL)) in test_ec_dhkem_derivekey_fail()
133 || !TEST_int_eq(EVP_PKEY_keygen_init(genctx), 1) in test_ec_dhkem_derivekey_fail()
134 || !TEST_int_eq(EVP_PKEY_CTX_set_params(genctx, params), 1) in test_ec_dhkem_derivekey_fail()
135 || !TEST_int_eq(EVP_PKEY_generate(genctx, &pkey), 0)) in test_ec_dhkem_derivekey_fail()
144 if (!TEST_int_eq(EVP_PKEY_keygen_init(genctx), 1) in test_ec_dhkem_derivekey_fail()
145 || !TEST_int_eq(EVP_PKEY_CTX_set_params(genctx, params), 1) in test_ec_dhkem_derivekey_fail()
146 || !TEST_int_eq(EVP_PKEY_generate(genctx, &pkey), 0)) in test_ec_dhkem_derivekey_fail()
155 if (!TEST_int_eq(EVP_PKEY_CTX_set_params(genctx, params), 1) in test_ec_dhkem_derivekey_fail()
156 || !TEST_int_eq(EVP_PKEY_generate(genctx, &pkey), 0)) in test_ec_dhkem_derivekey_fail()
[all …]
H A Dml_kem_evp_extra_test.c426 EVP_PKEY_CTX *genctx = NULL; in test_mlx_kem_dup_partial_selection() local
434 if (!TEST_ptr(genctx = EVP_PKEY_CTX_new_from_name(testctx, alg, NULL)) in test_mlx_kem_dup_partial_selection()
435 || !TEST_int_eq(EVP_PKEY_keygen_init(genctx), 1) in test_mlx_kem_dup_partial_selection()
436 || !TEST_int_eq(EVP_PKEY_keygen(genctx, &keypair), 1)) in test_mlx_kem_dup_partial_selection()
471 EVP_PKEY_CTX_free(genctx); in test_mlx_kem_dup_partial_selection()
H A Dtls-provider.c573 void *genctx = NULL, *derivectx = NULL; in xor_encapsulate() local
590 genctx = xor_gen_init(pxorctx->provctx, OSSL_KEYMGMT_SELECT_KEYPAIR, NULL); in xor_encapsulate()
591 if (genctx == NULL) in xor_encapsulate()
593 ourkey = xor_gen(genctx, NULL, NULL); in xor_encapsulate()
612 xor_gen_cleanup(genctx); in xor_encapsulate()
943 static int xor_gen_set_params(void *genctx, const OSSL_PARAM params[]) in xor_gen_set_params() argument
945 struct xor_gen_ctx *gctx = genctx; in xor_gen_set_params()
962 static const OSSL_PARAM *xor_gen_settable_params(ossl_unused void *genctx, in xor_gen_settable_params() argument
972 static void *xor_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) in xor_gen() argument
974 struct xor_gen_ctx *gctx = genctx; in xor_gen()
[all …]
H A Dfake_rsaprov.c255 static void *fake_rsa_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) in fake_rsa_gen() argument
257 unsigned char *gctx = genctx; in fake_rsa_gen()
272 static void fake_rsa_gen_cleanup(void *genctx) in fake_rsa_gen_cleanup() argument
274 OPENSSL_free(genctx); in fake_rsa_gen_cleanup()
H A Devp_test.c1750 EVP_PKEY_CTX *pctx = NULL, *genctx = NULL; in mac_test_run_pkey() local
1862 EVP_PKEY_CTX_free(genctx); in mac_test_run_pkey()
4378 EVP_PKEY_CTX *genctx = NULL; /* Keygen context to use */ in keygen_test_run() local
4392 if (!TEST_ptr(genctx = EVP_PKEY_CTX_new_from_pkey(libctx, keyparams, in keygen_test_run()
4397 if (!TEST_ptr(genctx = EVP_PKEY_CTX_new_from_name(libctx, keygen->alg, in keygen_test_run()
4402 if (EVP_PKEY_keygen_init(genctx) <= 0) { in keygen_test_run()
4411 EVP_PKEY_CTX_settable_params(genctx), in keygen_test_run()
4414 if (!EVP_PKEY_CTX_set_params(genctx, params)) { in keygen_test_run()
4420 if (EVP_PKEY_keygen(genctx, &pkey) <= 0) { in keygen_test_run()
4425 if (!pkey_check_fips_approved(genctx, t)) { in keygen_test_run()
[all …]
/freebsd/crypto/openssl/providers/implementations/keymgmt/
H A Dmac_legacy_kmgmt.c411 static int mac_gen_set_params(void *genctx, const OSSL_PARAM params[]) in mac_gen_set_params() argument
413 struct mac_gen_ctx *gctx = genctx; in mac_gen_set_params()
435 static int cmac_gen_set_params(void *genctx, const OSSL_PARAM params[]) in cmac_gen_set_params() argument
437 struct mac_gen_ctx *gctx = genctx; in cmac_gen_set_params()
439 if (!mac_gen_set_params(genctx, params)) in cmac_gen_set_params()
451 static const OSSL_PARAM *mac_gen_settable_params(ossl_unused void *genctx, in mac_gen_settable_params() argument
461 static const OSSL_PARAM *cmac_gen_settable_params(ossl_unused void *genctx, in cmac_gen_settable_params() argument
472 static void *mac_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg) in mac_gen() argument
474 struct mac_gen_ctx *gctx = genctx; in mac_gen()
515 static void mac_gen_cleanup(void *genctx) in mac_gen_cleanup() argument
[all …]
H A Ddh_kmgmt.c499 static int dh_gen_set_template(void *genctx, void *templ) in dh_gen_set_template() argument
501 struct dh_gen_ctx *gctx = genctx; in dh_gen_set_template()
525 static int dh_gen_common_set_params(void *genctx, const OSSL_PARAM params[]) in dh_gen_common_set_params() argument
527 struct dh_gen_ctx *gctx = genctx; in dh_gen_common_set_params()
567 static const OSSL_PARAM *dh_gen_settable_params(ossl_unused void *genctx, in dh_gen_settable_params() argument
581 static const OSSL_PARAM *dhx_gen_settable_params(ossl_unused void *genctx, in dhx_gen_settable_params() argument
601 static int dhx_gen_set_params(void *genctx, const OSSL_PARAM params[]) in dhx_gen_set_params() argument
603 struct dh_gen_ctx *gctx = genctx; in dhx_gen_set_params()
606 if (!dh_gen_common_set_params(genctx, params)) in dhx_gen_set_params()
655 static int dh_gen_set_params(void *genctx, const OSSL_PARAM params[]) in dh_gen_set_params() argument
[all …]
H A Ddsa_kmgmt.c437 static int dsa_gen_set_template(void *genctx, void *templ) in dsa_gen_set_template() argument
439 struct dsa_gen_ctx *gctx = genctx; in dsa_gen_set_template()
463 static int dsa_gen_set_params(void *genctx, const OSSL_PARAM params[]) in dsa_gen_set_params() argument
465 struct dsa_gen_ctx *gctx = genctx; in dsa_gen_set_params()
538 static const OSSL_PARAM *dsa_gen_settable_params(ossl_unused void *genctx, in dsa_gen_settable_params() argument
557 static int dsa_gen_get_params(void *genctx, OSSL_PARAM *params) in dsa_gen_get_params() argument
559 struct dsa_gen_ctx *gctx = genctx; in dsa_gen_get_params()
592 static void *dsa_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) in dsa_gen() argument
594 struct dsa_gen_ctx *gctx = genctx; in dsa_gen()
638 BN_GENCB_set(gencb, dsa_gencb, genctx); in dsa_gen()
[all …]
H A Dslh_dsa_kmgmt.c357 static void *slh_dsa_gen(void *genctx, const char *alg) in slh_dsa_gen() argument
359 struct slh_dsa_gen_ctx *gctx = genctx; in slh_dsa_gen()
386 static int slh_dsa_gen_set_params(void *genctx, const OSSL_PARAM params[]) in slh_dsa_gen_set_params() argument
388 struct slh_dsa_gen_ctx *gctx = genctx; in slh_dsa_gen_set_params()
417 static const OSSL_PARAM *slh_dsa_gen_settable_params(ossl_unused void *genctx, in slh_dsa_gen_settable_params() argument
428 static void slh_dsa_gen_cleanup(void *genctx) in slh_dsa_gen_cleanup() argument
430 struct slh_dsa_gen_ctx *gctx = genctx; in slh_dsa_gen_cleanup()
447 static void *slh_dsa_##fn##_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) \
449 return slh_dsa_gen(genctx, alg); \
H A Dml_dsa_kmgmt.c466 static void *ml_dsa_gen(void *genctx, int evp_type) in ml_dsa_gen() argument
468 struct ml_dsa_gen_ctx *gctx = genctx; in ml_dsa_gen()
494 static int ml_dsa_gen_set_params(void *genctx, const OSSL_PARAM params[]) in ml_dsa_gen_set_params() argument
496 struct ml_dsa_gen_ctx *gctx = genctx; in ml_dsa_gen_set_params()
523 static const OSSL_PARAM *ml_dsa_gen_settable_params(ossl_unused void *genctx, in ml_dsa_gen_settable_params() argument
534 static void ml_dsa_gen_cleanup(void *genctx) in ml_dsa_gen_cleanup() argument
536 struct ml_dsa_gen_ctx *gctx = genctx; in ml_dsa_gen_cleanup()
560 static void *ml_dsa_##alg##_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) \
562 return ml_dsa_gen(genctx, EVP_PKEY_ML_DSA_##alg); \
H A Drsa_kmgmt.c497 static int rsa_gen_set_params(void *genctx, const OSSL_PARAM params[]) in rsa_gen_set_params() argument
499 struct rsa_gen_ctx *gctx = genctx; in rsa_gen_set_params()
548 static const OSSL_PARAM *rsa_gen_settable_params(ossl_unused void *genctx, in rsa_gen_settable_params() argument
559 static const OSSL_PARAM *rsapss_gen_settable_params(ossl_unused void *genctx, in rsapss_gen_settable_params() argument
571 static void *rsa_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) in rsa_gen() argument
573 struct rsa_gen_ctx *gctx = genctx; in rsa_gen()
604 BN_GENCB_set(gencb, rsa_gencb, genctx); in rsa_gen()
633 static void rsa_gen_cleanup(void *genctx) in rsa_gen_cleanup() argument
635 struct rsa_gen_ctx *gctx = genctx; in rsa_gen_cleanup()
H A Dec_kmgmt.c1010 static int ec_gen_set_group(void *genctx, const EC_GROUP *src) in ec_gen_set_group() argument
1012 struct ec_gen_ctx *gctx = genctx; in ec_gen_set_group()
1025 static int ec_gen_set_template(void *genctx, void *templ) in ec_gen_set_template() argument
1027 struct ec_gen_ctx *gctx = genctx; in ec_gen_set_template()
1075 static int ec_gen_set_params(void *genctx, const OSSL_PARAM params[]) in ec_gen_set_params() argument
1078 struct ec_gen_ctx *gctx = genctx; in ec_gen_set_params()
1188 static const OSSL_PARAM *ec_gen_settable_params(ossl_unused void *genctx, in ec_gen_settable_params() argument
1211 static const OSSL_PARAM *ec_gen_gettable_params(ossl_unused void *genctx, in ec_gen_gettable_params() argument
1221 static int ec_gen_get_params(void *genctx, OSSL_PARAM *params) in ec_gen_get_params() argument
1223 struct ec_gen_ctx *gctx = genctx; in ec_gen_get_params()
[all …]
H A Dtemplate_kmgmt.c321 static int template_gen_set_params(void *genctx, const OSSL_PARAM params[]) in template_gen_set_params() argument
323 struct template_gen_ctx *gctx = genctx; in template_gen_set_params()
356 static const OSSL_PARAM *template_gen_settable_params(ossl_unused void *genctx, in template_gen_settable_params() argument
385 static void template_gen_cleanup(void *genctx) in template_gen_cleanup() argument
387 struct template_gen_ctx *gctx = genctx; in template_gen_cleanup()
H A Decx_kmgmt.c557 static int ecx_gen_set_params(void *genctx, const OSSL_PARAM params[]) in ecx_gen_set_params() argument
559 struct ecx_gen_ctx *gctx = genctx; in ecx_gen_set_params()
615 static const OSSL_PARAM *ecx_gen_settable_params(ossl_unused void *genctx, in ecx_gen_settable_params() argument
761 static void *x25519_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) in x25519_gen() argument
763 struct ecx_gen_ctx *gctx = genctx; in x25519_gen()
775 static void *x448_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) in x448_gen() argument
777 struct ecx_gen_ctx *gctx = genctx; in x448_gen()
789 static void *ed25519_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) in ed25519_gen() argument
792 struct ecx_gen_ctx *gctx = genctx; in ed25519_gen()
822 static void *ed448_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg) in ed448_gen() argument
[all …]
/freebsd/crypto/openssl/crypto/evp/
H A Dkeymgmt_meth.c395 int evp_keymgmt_gen_set_template(const EVP_KEYMGMT *keymgmt, void *genctx, in evp_keymgmt_gen_set_template() argument
406 return keymgmt->gen_set_template(genctx, templ); in evp_keymgmt_gen_set_template()
409 int evp_keymgmt_gen_set_params(const EVP_KEYMGMT *keymgmt, void *genctx, in evp_keymgmt_gen_set_params() argument
414 return keymgmt->gen_set_params(genctx, params); in evp_keymgmt_gen_set_params()
426 int evp_keymgmt_gen_get_params(const EVP_KEYMGMT *keymgmt, void *genctx, in evp_keymgmt_gen_get_params() argument
431 return keymgmt->gen_get_params(genctx, params); in evp_keymgmt_gen_get_params()
443 void *evp_keymgmt_gen(const EVP_KEYMGMT *keymgmt, void *genctx, in evp_keymgmt_gen() argument
456 ret = keymgmt->gen(genctx, cb, cbarg); in evp_keymgmt_gen()
464 void evp_keymgmt_gen_cleanup(const EVP_KEYMGMT *keymgmt, void *genctx) in evp_keymgmt_gen_cleanup() argument
467 keymgmt->gen_cleanup(genctx); in evp_keymgmt_gen_cleanup()
H A Dpmeth_gn.c40 ctx->op.keymgmt.genctx = evp_keymgmt_gen_init(ctx->keymgmt, in gen_init()
44 ctx->op.keymgmt.genctx = evp_keymgmt_gen_init(ctx->keymgmt, OSSL_KEYMGMT_SELECT_KEYPAIR, in gen_init()
49 if (ctx->op.keymgmt.genctx == NULL) in gen_init()
150 if (ctx->op.keymgmt.genctx == NULL) in EVP_PKEY_generate()
178 ctx->op.keymgmt.genctx, keydata); in EVP_PKEY_generate()
186 && (evp_keymgmt_util_gen(*ppkey, ctx->keymgmt, ctx->op.keymgmt.genctx, in EVP_PKEY_generate()
H A Dpmeth_lib.c150 && ctx->op.keymgmt.genctx != NULL) in evp_pkey_ctx_state()
385 if (ctx->op.keymgmt.genctx != NULL && ctx->keymgmt != NULL) in evp_pkey_ctx_free_old_ops()
386 evp_keymgmt_gen_cleanup(ctx->keymgmt, ctx->op.keymgmt.genctx); in evp_pkey_ctx_free_old_ops()
699 return evp_keymgmt_gen_set_params(ctx->keymgmt, ctx->op.keymgmt.genctx, in EVP_PKEY_CTX_set_params()
744 return evp_keymgmt_gen_get_params(ctx->keymgmt, ctx->op.keymgmt.genctx, in EVP_PKEY_CTX_get_params()
796 return ctx->keymgmt->gen_gettable_params(ctx->op.keymgmt.genctx, in EVP_PKEY_CTX_gettable_params()
833 return ctx->keymgmt->gen_settable_params(ctx->op.keymgmt.genctx, in EVP_PKEY_CTX_settable_params()
1255 return evp_pkey_ctx_set1_octet_string(ctx, ctx->op.keymgmt.genctx == NULL, in EVP_PKEY_CTX_set_mac_key()
H A Dkeymgmt_lib.c512 void *genctx, OSSL_CALLBACK *cb, void *cbarg) in evp_keymgmt_util_gen() argument
516 if ((keydata = evp_keymgmt_gen(keymgmt, genctx, cb, cbarg)) == NULL in evp_keymgmt_util_gen()
/freebsd/crypto/openssl/apps/
H A Dreq.c289 EVP_PKEY_CTX *genctx = NULL; in req_main() local
680 genctx = set_keygen_ctx(keyalg, &keyalgstr, &newkey_len, gen_eng); in req_main()
681 if (genctx == NULL) in req_main()
685 && (EVP_PKEY_CTX_is_a(genctx, "RSA") in req_main()
686 || EVP_PKEY_CTX_is_a(genctx, "RSA-PSS") in req_main()
687 || EVP_PKEY_CTX_is_a(genctx, "DSA"))) { in req_main()
694 && (EVP_PKEY_CTX_is_a(genctx, "RSA") in req_main()
695 || EVP_PKEY_CTX_is_a(genctx, "RSA-PSS"))) in req_main()
702 if (EVP_PKEY_CTX_is_a(genctx, "DSA") in req_main()
714 if (pkey_ctrl_string(genctx, genopt) <= 0) { in req_main()
[all …]
H A Dspeed.c1979 EVP_PKEY_CTX *genctx = NULL; in speed_main() local
3294 && init_gen_str(&genctx, "RSA", NULL, 0, NULL, NULL) in speed_main()
3295 && EVP_PKEY_CTX_set_rsa_keygen_bits(genctx, rsa_keys[testnum].bits) > 0 in speed_main()
3296 && EVP_PKEY_CTX_set1_rsa_keygen_pubexp(genctx, bn) > 0 in speed_main()
3297 && EVP_PKEY_CTX_set_rsa_keygen_primes(genctx, primes) > 0 in speed_main()
3298 && EVP_PKEY_keygen(genctx, &rsa_key) > 0; in speed_main()
3301 EVP_PKEY_CTX_free(genctx); in speed_main()
3302 genctx = NULL; in speed_main()
4757 EVP_PKEY_CTX_free(genctx); in speed_main()
/freebsd/crypto/openssl/doc/man7/
H A Dprovider-keymgmt.pod24 int OSSL_FUNC_keymgmt_gen_set_template(void *genctx, void *template);
25 int OSSL_FUNC_keymgmt_gen_get_params(void *genctx, OSSL_PARAM params[]);
26 int OSSL_FUNC_keymgmt_gen_set_params(void *genctx, const OSSL_PARAM params[]);
27 const OSSL_PARAM *OSSL_FUNC_keymgmt_gen_gettable_params(void *genctx,
29 const OSSL_PARAM *OSSL_FUNC_keymgmt_gen_settable_params(void *genctx,
31 void *OSSL_FUNC_keymgmt_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg);
32 void OSSL_FUNC_keymgmt_gen_cleanup(void *genctx);
239 I<genctx>. The I<template> is assumed to be a key object constructed
246 I<params> in the key object generation context I<genctx>.
253 I<params> in the key object generation context I<genctx>.
[all …]
/freebsd/crypto/openssl/include/crypto/
H A Devp.h56 void *genctx; member
817 void *genctx, OSSL_CALLBACK *cb, void *cbarg);
835 int evp_keymgmt_gen_set_template(const EVP_KEYMGMT *keymgmt, void *genctx,
837 int evp_keymgmt_gen_set_params(const EVP_KEYMGMT *keymgmt, void *genctx,
840 void *genctx, OSSL_PARAM params[]);
841 void *evp_keymgmt_gen(const EVP_KEYMGMT *keymgmt, void *genctx,
843 void evp_keymgmt_gen_cleanup(const EVP_KEYMGMT *keymgmt, void *genctx);
/freebsd/crypto/openssl/include/openssl/
H A Dcore_dispatch.h625 (void *genctx, void *templ))
627 (void *genctx, const OSSL_PARAM params[]))
630 (void *genctx, void *provctx))
632 (void *genctx, OSSL_PARAM params[]))
634 (void *genctx, void *provctx))
636 (void *genctx, OSSL_CALLBACK *cb, void *cbarg))
637 OSSL_CORE_MAKE_FUNC(void, keymgmt_gen_cleanup, (void *genctx))

12