blob: d0e74b9206a80c668ae2f06b1c0d1ec91cfc3d77 [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * Diffie-Hellman groups
3 * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
4 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#ifndef DH_GROUPS_H
10#define DH_GROUPS_H
11
12struct dh_group {
13 int id;
14 const u8 *generator;
15 size_t generator_len;
16 const u8 *prime;
17 size_t prime_len;
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -080018 const u8 *order;
19 size_t order_len;
20 unsigned int safe_prime:1;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070021};
22
23const struct dh_group * dh_groups_get(int id);
24struct wpabuf * dh_init(const struct dh_group *dh, struct wpabuf **priv);
25struct 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 */