Lines Matching defs:ctx
54 static int pkey_dh_init(EVP_PKEY_CTX *ctx)
67 ctx->data = dctx;
68 ctx->keygen_info = dctx->gentmp;
69 ctx->keygen_info_count = 2;
74 static void pkey_dh_cleanup(EVP_PKEY_CTX *ctx)
76 DH_PKEY_CTX *dctx = ctx->data;
117 static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
119 DH_PKEY_CTX *dctx = ctx->data;
224 static int pkey_dh_ctrl_str(EVP_PKEY_CTX *ctx,
230 return EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len);
233 DH_PKEY_CTX *dctx = ctx->data;
243 DH_PKEY_CTX *dctx = ctx->data;
256 return EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, len);
261 return EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len);
266 return EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ);
271 return EVP_PKEY_CTX_set_dh_pad(ctx, pad);
322 static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx,
326 DH_PKEY_CTX *dctx = ctx->data;
344 if (ctx->pkey_gencb != NULL) {
348 evp_pkey_set_cb_translate(pcb, ctx);
376 static int pkey_dh_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
378 DH_PKEY_CTX *dctx = ctx->data;
381 if (ctx->pkey == NULL && dctx->param_nid == NID_undef) {
391 EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, dh);
393 if (ctx->pkey != NULL && !EVP_PKEY_copy_parameters(pkey, ctx->pkey))
398 static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
404 DH_PKEY_CTX *dctx = ctx->data;
407 if (ctx->pkey == NULL || ctx->peerkey == NULL) {
411 dh = (DH *)EVP_PKEY_get0_DH(ctx->pkey);
412 dhpub = EVP_PKEY_get0_DH(ctx->peerkey);