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