Lines Matching defs:ctx

47 static int pkey_ec_init(EVP_PKEY_CTX *ctx)
58 ctx->data = dctx;
94 static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx)
96 EC_PKEY_CTX *dctx = ctx->data;
102 ctx->data = NULL;
106 static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
111 EC_PKEY_CTX *dctx = ctx->data;
117 EC_KEY *ec = (EC_KEY *)EVP_PKEY_get0_EC_KEY(ctx->pkey);
144 static int pkey_ec_verify(EVP_PKEY_CTX *ctx,
149 EC_PKEY_CTX *dctx = ctx->data;
155 EC_KEY *ec = (EC_KEY *)EVP_PKEY_get0_EC_KEY(ctx->pkey);
168 static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
175 EC_PKEY_CTX *dctx = ctx->data;
177 if (ctx->pkey == NULL || ctx->peerkey == NULL) {
181 eckeypub = EVP_PKEY_get0_EC_KEY(ctx->peerkey);
188 : (EC_KEY *)EVP_PKEY_get0_EC_KEY(ctx->pkey);
215 static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx,
218 EC_PKEY_CTX *dctx = ctx->data;
223 return pkey_ec_derive(ctx, key, keylen);
230 if (!pkey_ec_derive(ctx, NULL, &ktmplen))
236 if (!pkey_ec_derive(ctx, ktmp, &ktmplen))
241 ctx->libctx, ctx->propquery))
251 static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
253 EC_PKEY_CTX *dctx = ctx->data;
280 const EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(ctx->pkey);
287 EC_KEY *ec_key = (EC_KEY *)EVP_PKEY_get0_EC_KEY(ctx->pkey);
293 if (evp_pkey_is_provided(ctx->pkey)) {
392 static int pkey_ec_ctrl_str(EVP_PKEY_CTX *ctx,
406 return EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid);
415 return EVP_PKEY_CTX_set_ec_param_enc(ctx, param_enc);
422 return EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md);
426 return EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, co_mode);
432 static int pkey_ec_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
435 EC_PKEY_CTX *dctx = ctx->data;
451 static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
454 EC_PKEY_CTX *dctx = ctx->data;
457 if (ctx->pkey == NULL && dctx->gen_group == NULL) {
469 if (ctx->pkey != NULL)
470 ret = EVP_PKEY_copy_parameters(pkey, ctx->pkey);