Lines Matching refs:ctx
67 int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx)
70 if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen)
76 ctx->operation = EVP_PKEY_OP_PARAMGEN;
77 if (!ctx->pmeth->paramgen_init)
79 ret = ctx->pmeth->paramgen_init(ctx);
81 ctx->operation = EVP_PKEY_OP_UNDEFINED;
85 int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
88 if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen)
95 if (ctx->operation != EVP_PKEY_OP_PARAMGEN)
107 ret = ctx->pmeth->paramgen(ctx, *ppkey);
116 int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx)
119 if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen)
125 ctx->operation = EVP_PKEY_OP_KEYGEN;
126 if (!ctx->pmeth->keygen_init)
128 ret = ctx->pmeth->keygen_init(ctx);
130 ctx->operation = EVP_PKEY_OP_UNDEFINED;
134 int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
138 if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen)
144 if (ctx->operation != EVP_PKEY_OP_KEYGEN)
156 ret = ctx->pmeth->keygen(ctx, *ppkey);
165 void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb)
167 ctx->pkey_gencb = cb;
170 EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx)
172 return ctx->pkey_gencb;
181 EVP_PKEY_CTX *ctx = gcb->arg;
182 ctx->keygen_info[0] = a;
183 ctx->keygen_info[1] = b;
184 return ctx->pkey_gencb(ctx);
187 void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx)
189 BN_GENCB_set(cb, trans_cb, ctx)
192 int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx)
195 return ctx->keygen_info_count;
196 if (idx < 0 || idx > ctx->keygen_info_count)
198 return ctx->keygen_info[idx];