Lines Matching defs:gctx
442 struct rsa_gen_ctx *gctx = BN_GENCB_get_arg(cb);
447 return gctx->cb(params, gctx->cbarg);
454 struct rsa_gen_ctx *gctx = NULL;
462 if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) {
463 gctx->libctx = libctx;
464 if ((gctx->pub_exp = BN_new()) == NULL
465 || !BN_set_word(gctx->pub_exp, RSA_F4)) {
468 gctx->nbits = 2048;
469 gctx->primes = RSA_DEFAULT_PRIME_NUM;
470 gctx->rsa_type = rsa_type;
475 if (!rsa_gen_set_params(gctx, params))
477 return gctx;
480 if (gctx != NULL)
481 BN_free(gctx->pub_exp);
482 OPENSSL_free(gctx);
505 struct rsa_gen_ctx *gctx = genctx;
512 if (!OSSL_PARAM_get_size_t(p, &gctx->nbits))
514 if (gctx->nbits < RSA_MIN_MODULUS_BITS) {
520 && !OSSL_PARAM_get_size_t(p, &gctx->primes))
523 && !OSSL_PARAM_get_BN(p, &gctx->pub_exp))
526 if (gctx->rsa_type == RSA_FLAG_TYPE_RSASSAPSS
527 && !pss_params_fromdata(&gctx->pss_params, &gctx->pss_defaults_set, params,
528 gctx->rsa_type, gctx->libctx))
532 if (!ossl_rsa_acvp_test_gen_params_new(&gctx->acvp_test_params, params))
579 struct rsa_gen_ctx *gctx = genctx;
583 if (!ossl_prov_is_running() || gctx == NULL)
586 switch (gctx->rsa_type) {
589 if (!ossl_rsa_pss_params_30_is_unrestricted(&gctx->pss_params))
603 if ((rsa_tmp = ossl_rsa_new_with_ctx(gctx->libctx)) == NULL)
606 gctx->cb = osslcb;
607 gctx->cbarg = cbarg;
613 if (gctx->acvp_test_params != NULL) {
614 if (!ossl_rsa_acvp_test_set_params(rsa_tmp, gctx->acvp_test_params))
620 (int)gctx->nbits, (int)gctx->primes,
621 gctx->pub_exp, gencb))
625 &gctx->pss_params))
629 RSA_set_flags(rsa_tmp, gctx->rsa_type);
641 struct rsa_gen_ctx *gctx = genctx;
643 if (gctx == NULL)
646 ossl_rsa_acvp_test_gen_params_free(gctx->acvp_test_params);
647 gctx->acvp_test_params = NULL;
649 BN_clear_free(gctx->pub_exp);
650 OPENSSL_free(gctx);