Lines Matching refs:ecdh
2091 struct crypto_ecdh *ecdh = NULL; in _crypto_ecdh_init() local
2096 ecdh = os_zalloc(sizeof(*ecdh)); in _crypto_ecdh_init()
2097 if (!ecdh) { in _crypto_ecdh_init()
2102 ecdh->rng = wc_rng_init(); in _crypto_ecdh_init()
2103 if (!ecdh->rng) { in _crypto_ecdh_init()
2108 ecdh->ec = crypto_ec_init(group); in _crypto_ecdh_init()
2109 if (!ecdh->ec) { in _crypto_ecdh_init()
2115 ret = wc_ecc_set_rng(ecdh->ec->key, ecdh->rng); in _crypto_ecdh_init()
2122 return ecdh; in _crypto_ecdh_init()
2124 crypto_ecdh_deinit(ecdh); in _crypto_ecdh_init()
2183 void crypto_ecdh_deinit(struct crypto_ecdh *ecdh) in crypto_ecdh_deinit() argument
2185 if (ecdh) { in crypto_ecdh_deinit()
2188 if (ecdh->ec && ecdh->ec->key && in crypto_ecdh_deinit()
2189 ecdh->ec->key->rng == ecdh->rng) in crypto_ecdh_deinit()
2190 (void) wc_ecc_set_rng(ecdh->ec->key, NULL); in crypto_ecdh_deinit()
2192 crypto_ec_deinit(ecdh->ec); in crypto_ecdh_deinit()
2193 wc_rng_deinit(ecdh->rng); in crypto_ecdh_deinit()
2194 os_free(ecdh); in crypto_ecdh_deinit()
2199 struct wpabuf * crypto_ecdh_get_pubkey(struct crypto_ecdh *ecdh, int inc_y) in crypto_ecdh_get_pubkey() argument
2203 int len = ecdh->ec->key->dp->size; in crypto_ecdh_get_pubkey()
2210 ecdh->ec->key->pubkey.x, wpabuf_put(buf, len), in crypto_ecdh_get_pubkey()
2216 ecdh->ec->key->pubkey.y, in crypto_ecdh_get_pubkey()
2231 struct wpabuf * crypto_ecdh_set_peerkey(struct crypto_ecdh *ecdh, int inc_y, in crypto_ecdh_set_peerkey() argument
2237 word32 key_len = ecdh->ec->key->dp->size; in crypto_ecdh_set_peerkey()
2260 ecdh->ec->key->idx, point); in crypto_ecdh_set_peerkey()
2272 ret = wc_ecc_shared_secret_ex(ecdh->ec->key, point, in crypto_ecdh_set_peerkey()
2290 size_t crypto_ecdh_prime_len(struct crypto_ecdh *ecdh) in crypto_ecdh_prime_len() argument
2292 return crypto_ec_prime_len(ecdh->ec); in crypto_ecdh_prime_len()