Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Diffie-Hellman groups |
| 3 | * Copyright (c) 2007, Jouni Malinen <j@w1.fi> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * Alternatively, this software may be distributed under the terms of BSD |
| 10 | * license. |
| 11 | * |
| 12 | * See README and COPYING for more details. |
| 13 | */ |
| 14 | |
| 15 | #ifndef DH_GROUPS_H |
| 16 | #define DH_GROUPS_H |
| 17 | |
| 18 | struct dh_group { |
| 19 | int id; |
| 20 | const u8 *generator; |
| 21 | size_t generator_len; |
| 22 | const u8 *prime; |
| 23 | size_t prime_len; |
| 24 | }; |
| 25 | |
| 26 | const struct dh_group * dh_groups_get(int id); |
| 27 | struct wpabuf * dh_init(const struct dh_group *dh, struct wpabuf **priv); |
| 28 | struct wpabuf * dh_derive_shared(const struct wpabuf *peer_public, |
| 29 | const struct wpabuf *own_private, |
| 30 | const struct dh_group *dh); |
| 31 | |
| 32 | #endif /* DH_GROUPS_H */ |