Lines Matching refs:group
148 static int EC_POINT_get_affine_coordinates(const EC_GROUP *group, in EC_POINT_get_affine_coordinates() argument
152 return EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx); in EC_POINT_get_affine_coordinates()
156 static int EC_POINT_set_affine_coordinates(const EC_GROUP *group, in EC_POINT_set_affine_coordinates() argument
160 return EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx); in EC_POINT_set_affine_coordinates()
171 static int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, in EC_POINT_set_compressed_coordinates() argument
175 return EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, in EC_POINT_set_compressed_coordinates()
180 static int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, in EC_GROUP_get_curve() argument
183 return EC_GROUP_get_curve_GFp(group, p, a, b, ctx); in EC_GROUP_get_curve()
2244 EC_GROUP *group; member
2255 static int crypto_ec_group_2_nid(int group) in crypto_ec_group_2_nid() argument
2258 switch (group) { in crypto_ec_group_2_nid()
2292 static const char * crypto_ec_group_2_name(int group) in crypto_ec_group_2_name() argument
2295 switch (group) { in crypto_ec_group_2_name()
2329 struct crypto_ec * crypto_ec_init(int group) in crypto_ec_init() argument
2334 nid = crypto_ec_group_2_nid(group); in crypto_ec_init()
2343 e->iana_group = group; in crypto_ec_init()
2345 e->group = EC_GROUP_new_by_curve_name(nid); in crypto_ec_init()
2350 if (e->group == NULL || e->bnctx == NULL || e->prime == NULL || in crypto_ec_init()
2352 !EC_GROUP_get_curve(e->group, e->prime, e->a, e->b, e->bnctx) || in crypto_ec_init()
2353 !EC_GROUP_get_order(e->group, e->order, e->bnctx)) { in crypto_ec_init()
2370 EC_GROUP_free(e->group); in crypto_ec_deinit()
2382 return (struct crypto_ec_point *) EC_POINT_new(e->group); in crypto_ec_point_init()
2431 EC_GROUP_get0_generator(e->group); in crypto_ec_get_generator()
2447 return EC_POINT_get_affine_coordinates(e->group, in crypto_ec_point_x()
2468 EC_POINT_get_affine_coordinates(e->group, (EC_POINT *) point, in crypto_ec_point_to_bin()
2501 elem = EC_POINT_new(e->group); in crypto_ec_point_from_bin()
2509 if (!EC_POINT_set_affine_coordinates(e->group, elem, x, y, e->bnctx)) { in crypto_ec_point_from_bin()
2527 return EC_POINT_add(e->group, (EC_POINT *) c, (const EC_POINT *) a, in crypto_ec_point_add()
2538 return EC_POINT_mul(e->group, (EC_POINT *) res, NULL, in crypto_ec_point_mul()
2548 return EC_POINT_invert(e->group, (EC_POINT *) p, e->bnctx) ? 0 : -1; in crypto_ec_point_invert()
2579 return EC_POINT_is_at_infinity(e->group, (const EC_POINT *) p); in crypto_ec_point_is_at_infinity()
2586 return EC_POINT_is_on_curve(e->group, (const EC_POINT *) p, in crypto_ec_point_is_on_curve()
2595 return EC_POINT_cmp(e->group, (const EC_POINT *) a, in crypto_ec_point_cmp()
2610 EC_POINT_get_affine_coordinates(e->group, (const EC_POINT *) p, in crypto_ec_point_debug_print()
2634 struct crypto_ecdh * crypto_ecdh_init(int group) in crypto_ecdh_init() argument
2644 ecdh->ec = crypto_ec_init(group); in crypto_ecdh_init()
2672 ecdh->ec = crypto_ec_init(group); in crypto_ecdh_init()
2721 struct crypto_ecdh * crypto_ecdh_init2(int group, struct crypto_ec_key *own_key) in crypto_ecdh_init2() argument
2730 ecdh->ec = crypto_ec_init(group); in crypto_ecdh_init2()
2749 ecdh->ec = crypto_ec_init(group); in crypto_ecdh_init2()
2817 if (EC_POINT_get_affine_coordinates(ecdh->ec->group, pubkey, in crypto_ecdh_get_pubkey()
2909 pub = EC_POINT_new(ecdh->ec->group); in crypto_ecdh_set_peerkey()
2917 if (!EC_POINT_set_affine_coordinates(ecdh->ec->group, pub, in crypto_ecdh_set_peerkey()
2924 } else if (!EC_POINT_set_compressed_coordinates(ecdh->ec->group, in crypto_ecdh_set_peerkey()
2933 if (!EC_POINT_is_on_curve(ecdh->ec->group, pub, ecdh->ec->bnctx)) { in crypto_ecdh_set_peerkey()
3060 struct crypto_ec_key * crypto_ec_key_set_priv(int group, in crypto_ec_key_set_priv() argument
3076 group_name = crypto_ec_group_2_name(group); in crypto_ec_key_set_priv()
3090 ec_group = EC_GROUP_new_by_curve_name(crypto_ec_group_2_nid(group)); in crypto_ec_key_set_priv()
3144 nid = crypto_ec_group_2_nid(group); in crypto_ec_key_set_priv()
3146 wpa_printf(MSG_ERROR, "OpenSSL: Unsupported group %d", group); in crypto_ec_key_set_priv()
3221 struct crypto_ec_key * crypto_ec_key_set_pub(int group, const u8 *buf_x, in crypto_ec_key_set_pub() argument
3231 group_name = crypto_ec_group_2_name(group); in crypto_ec_key_set_pub()
3276 nid = crypto_ec_group_2_nid(group); in crypto_ec_key_set_pub()
3278 wpa_printf(MSG_ERROR, "OpenSSL: Unsupported group %d", group); in crypto_ec_key_set_pub()
3370 EC_KEY_set_group(eckey, ec->group) != 1 || in crypto_ec_key_set_pub_point()
3397 struct crypto_ec_key * crypto_ec_key_gen(int group) in crypto_ec_key_gen() argument
3405 group_name = crypto_ec_group_2_name(group); in crypto_ec_key_gen()
3433 nid = crypto_ec_group_2_nid(group); in crypto_ec_key_gen()
3435 wpa_printf(MSG_ERROR, "OpenSSL: Unsupported group %d", group); in crypto_ec_key_gen()
3568 const EC_GROUP *group; in crypto_ec_key_get_subject_public_key() local
3579 group = EC_KEY_get0_group(eckey); in crypto_ec_key_get_subject_public_key()
3581 if (!group || !point) in crypto_ec_key_get_subject_public_key()
3583 nid = EC_GROUP_get_curve_name(group); in crypto_ec_key_get_subject_public_key()
3591 len = EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, in crypto_ec_key_get_subject_public_key()
3599 len = EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, in crypto_ec_key_get_subject_public_key()
3812 char group[64]; in crypto_ec_key_get_public_key() local
3822 group, sizeof(group), &len) != 1 || in crypto_ec_key_get_public_key()
3828 group, 0); in crypto_ec_key_get_public_key()
3850 const EC_GROUP *group; in crypto_ec_key_get_public_key() local
3855 group = EC_KEY_get0_group(eckey); in crypto_ec_key_get_public_key()
3856 if (!group) in crypto_ec_key_get_public_key()
3861 return (struct crypto_ec_point *) EC_POINT_dup(point, group); in crypto_ec_key_get_public_key()
3925 EC_GROUP *group; in openssl_evp_pkey_ec_prime_len() local
3933 group = EC_GROUP_new_by_curve_name(nid); in openssl_evp_pkey_ec_prime_len()
3935 if (!group || !prime) in openssl_evp_pkey_ec_prime_len()
3937 if (EC_GROUP_get_curve(group, prime, NULL, NULL, NULL) == 1) in openssl_evp_pkey_ec_prime_len()
3940 EC_GROUP_free(group); in openssl_evp_pkey_ec_prime_len()
3944 const EC_GROUP *group; in openssl_evp_pkey_ec_prime_len()
3952 group = EC_KEY_get0_group(eckey); in openssl_evp_pkey_ec_prime_len()
3954 if (!prime || !group || in openssl_evp_pkey_ec_prime_len()
3955 !EC_GROUP_get_curve(group, prime, NULL, NULL, NULL)) in openssl_evp_pkey_ec_prime_len()
4082 const EC_GROUP *group; in crypto_ec_key_group()
4088 group = EC_KEY_get0_group(eckey); in crypto_ec_key_group()
4089 if (!group) in crypto_ec_key_group()
4091 nid = EC_GROUP_get_curve_name(group); in crypto_ec_key_group()
4636 int group; in hpke_get_context() local
4709 group = crypto_ec_key_group(key); in hpke_get_context()
4710 if (group == 28 && ctx->iana_group == 19) { in hpke_get_context()
4712 } else if (group == 29 && ctx->iana_group == 20) { in hpke_get_context()
4714 } else if (group == 30 && ctx->iana_group == 21) { in hpke_get_context()
4718 if (group != ctx->iana_group) { in hpke_get_context()
4720 __func__, group, ctx->iana_group); in hpke_get_context()
5425 int group; in hpke_base_seal() local
5427 group = crypto_ec_key_group(peer_pub); in hpke_base_seal()
5428 if (group == 28 || group == 29 || group == 30) { in hpke_base_seal()
5494 int group; in hpke_base_open() local
5496 group = crypto_ec_key_group(own_priv); in hpke_base_open()
5497 if (group == 28 || group == 29 || group == 30) { in hpke_base_open()