Home | History | Annotate | Download | only in dh

Lines Matching refs:ctx

80 static int pkey_dh_init(EVP_PKEY_CTX *ctx)
90 ctx->data = dctx;
91 ctx->keygen_info = dctx->gentmp;
92 ctx->keygen_info_count = 2;
110 static void pkey_dh_cleanup(EVP_PKEY_CTX *ctx)
112 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;
143 static int pkey_dh_ctrl_str(EVP_PKEY_CTX *ctx,
150 return EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len);
156 return EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, len);
161 static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
164 DH_PKEY_CTX *dctx = ctx->data;
167 if (ctx->pkey_gencb)
170 evp_pkey_set_cb_translate(pcb, ctx);
186 static int pkey_dh_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
189 if (ctx->pkey == NULL)
199 if (!EVP_PKEY_copy_parameters(pkey, ctx->pkey))
204 static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
207 if (!ctx->pkey || !ctx->peerkey)
212 ret = DH_compute_key(key, ctx->peerkey->pkey.dh->pub_key,
213 ctx->pkey->pkey.dh);