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