Lines Matching defs:ecdh
1877 struct crypto_ecdh *ecdh;
1882 ecdh = os_zalloc(sizeof(*ecdh));
1883 if (!ecdh)
1886 ecdh->ec = crypto_ec_init(group);
1887 if (!ecdh->ec)
1890 ec_params = EC_KEY_new_by_curve_name(ecdh->ec->nid);
1915 if (EVP_PKEY_keygen(kctx, &ecdh->pkey) != 1) {
1926 return ecdh;
1928 crypto_ecdh_deinit(ecdh);
1929 ecdh = NULL;
1934 struct wpabuf * crypto_ecdh_get_pubkey(struct crypto_ecdh *ecdh, int inc_y)
1940 int len = BN_num_bytes(ecdh->ec->prime);
1943 eckey = EVP_PKEY_get1_EC_KEY(ecdh->pkey);
1961 if (EC_POINT_get_affine_coordinates_GFp(ecdh->ec->group, pubkey,
1962 x, y, ecdh->ec->bnctx) != 1) {
1994 struct wpabuf * crypto_ecdh_set_peerkey(struct crypto_ecdh *ecdh, int inc_y,
2006 pub = EC_POINT_new(ecdh->ec->group);
2014 if (!EC_POINT_set_affine_coordinates_GFp(ecdh->ec->group, pub,
2016 ecdh->ec->bnctx)) {
2022 } else if (!EC_POINT_set_compressed_coordinates_GFp(ecdh->ec->group,
2024 ecdh->ec->bnctx)) {
2031 if (!EC_POINT_is_on_curve(ecdh->ec->group, pub, ecdh->ec->bnctx)) {
2037 eckey = EC_KEY_new_by_curve_name(ecdh->ec->nid);
2049 ctx = EVP_PKEY_CTX_new(ecdh->pkey, NULL);
2089 void crypto_ecdh_deinit(struct crypto_ecdh *ecdh)
2091 if (ecdh) {
2092 crypto_ec_deinit(ecdh->ec);
2093 EVP_PKEY_free(ecdh->pkey);
2094 os_free(ecdh);