1e5b75505Sopenharmony_ci/* 2e5b75505Sopenharmony_ci * Diffie-Hellman groups 3e5b75505Sopenharmony_ci * Copyright (c) 2007, Jouni Malinen <j@w1.fi> 4e5b75505Sopenharmony_ci * 5e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license. 6e5b75505Sopenharmony_ci * See README for more details. 7e5b75505Sopenharmony_ci */ 8e5b75505Sopenharmony_ci 9e5b75505Sopenharmony_ci#ifndef DH_GROUPS_H 10e5b75505Sopenharmony_ci#define DH_GROUPS_H 11e5b75505Sopenharmony_ci 12e5b75505Sopenharmony_cistruct dh_group { 13e5b75505Sopenharmony_ci int id; 14e5b75505Sopenharmony_ci const u8 *generator; 15e5b75505Sopenharmony_ci size_t generator_len; 16e5b75505Sopenharmony_ci const u8 *prime; 17e5b75505Sopenharmony_ci size_t prime_len; 18e5b75505Sopenharmony_ci const u8 *order; 19e5b75505Sopenharmony_ci size_t order_len; 20e5b75505Sopenharmony_ci unsigned int safe_prime:1; 21e5b75505Sopenharmony_ci}; 22e5b75505Sopenharmony_ci 23e5b75505Sopenharmony_ciconst struct dh_group * dh_groups_get(int id); 24e5b75505Sopenharmony_cistruct wpabuf * dh_init(const struct dh_group *dh, struct wpabuf **priv); 25e5b75505Sopenharmony_cistruct wpabuf * dh_derive_shared(const struct wpabuf *peer_public, 26e5b75505Sopenharmony_ci const struct wpabuf *own_private, 27e5b75505Sopenharmony_ci const struct dh_group *dh); 28e5b75505Sopenharmony_ci 29e5b75505Sopenharmony_ci#endif /* DH_GROUPS_H */ 30