Lines Matching refs:pkey

68 static int eckey_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
70 const EC_KEY *ec_key = pkey->pkey.ec;
100 static int eckey_pub_decode(EVP_PKEY *pkey, const X509_PUBKEY *pubkey)
123 EVP_PKEY_assign_EC_KEY(pkey, eckey);
134 const EC_GROUP *group = EC_KEY_get0_group(b->pkey.ec);
135 const EC_POINT *pa = EC_KEY_get0_public_key(a->pkey.ec),
136 *pb = EC_KEY_get0_public_key(b->pkey.ec);
148 static int eckey_priv_decode_ex(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8,
156 EVP_PKEY_assign_EC_KEY(pkey, eckey);
162 static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
164 EC_KEY ec_key = *(pkey->pkey.ec);
205 static int int_ec_size(const EVP_PKEY *pkey)
207 return ECDSA_size(pkey->pkey.ec);
210 static int ec_bits(const EVP_PKEY *pkey)
212 return EC_GROUP_order_bits(EC_KEY_get0_group(pkey->pkey.ec));
215 static int ec_security_bits(const EVP_PKEY *pkey)
217 int ecbits = ec_bits(pkey);
232 static int ec_missing_parameters(const EVP_PKEY *pkey)
234 if (pkey->pkey.ec == NULL || EC_KEY_get0_group(pkey->pkey.ec) == NULL)
241 EC_GROUP *group = EC_GROUP_dup(EC_KEY_get0_group(from->pkey.ec));
245 if (to->pkey.ec == NULL) {
246 to->pkey.ec = EC_KEY_new();
247 if (to->pkey.ec == NULL)
250 if (EC_KEY_set_group(to->pkey.ec, group) == 0)
261 const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec),
262 *group_b = EC_KEY_get0_group(b->pkey.ec);
272 static void int_ec_free(EVP_PKEY *pkey)
274 EC_KEY_free(pkey->pkey.ec);
346 static int eckey_param_decode(EVP_PKEY *pkey,
353 EVP_PKEY_assign_EC_KEY(pkey, eckey);
357 static int eckey_param_encode(const EVP_PKEY *pkey, unsigned char **pder)
359 return i2d_ECParameters(pkey->pkey.ec, pder);
362 static int eckey_param_print(BIO *bp, const EVP_PKEY *pkey, int indent,
365 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, EC_KEY_PRINT_PARAM);
368 static int eckey_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent,
371 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, EC_KEY_PRINT_PUBLIC);
374 static int eckey_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
377 return do_EC_KEY_print(bp, pkey->pkey.ec, indent, EC_KEY_PRINT_PRIVATE);
380 static int old_ec_priv_decode(EVP_PKEY *pkey,
387 EVP_PKEY_assign_EC_KEY(pkey, ec);
391 static int old_ec_priv_encode(const EVP_PKEY *pkey, unsigned char **pder)
393 return i2d_ECPrivateKey(pkey->pkey.ec, pder);
396 static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
400 if (EVP_PKEY_get_id(pkey) == EVP_PKEY_SM2) {
410 if (!ossl_assert(evp_pkey_is_legacy(pkey)))
412 return EC_KEY_oct2key(evp_pkey_get0_EC_KEY_int(pkey), arg2, arg1, NULL);
415 return EC_KEY_key2buf(EVP_PKEY_get0_EC_KEY(pkey),
423 static int ec_pkey_check(const EVP_PKEY *pkey)
425 EC_KEY *eckey = pkey->pkey.ec;
436 static int ec_pkey_public_check(const EVP_PKEY *pkey)
438 EC_KEY *eckey = pkey->pkey.ec;
452 static int ec_pkey_param_check(const EVP_PKEY *pkey)
454 EC_KEY *eckey = pkey->pkey.ec;
466 size_t ec_pkey_dirty_cnt(const EVP_PKEY *pkey)
468 return pkey->pkey.ec->dirty_cnt;
489 || (eckey = from->pkey.ec) == NULL
612 EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx);
623 || !EVP_PKEY_assign_EC_KEY(pkey, ec)) {
632 EC_KEY *eckey = from->pkey.ec;