xref: /freebsd/contrib/wpa/src/crypto/dh_group5.c (revision 780fb4a2fa9a9aee5ac48a60b790f567c0dc13e9)
1e28a4053SRui Paulo /*
2e28a4053SRui Paulo  * Diffie-Hellman group 5 operations
3f05cddf9SRui Paulo  * Copyright (c) 2009, 2012, Jouni Malinen <j@w1.fi>
4e28a4053SRui Paulo  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
7e28a4053SRui Paulo  */
8e28a4053SRui Paulo 
9e28a4053SRui Paulo #include "includes.h"
10e28a4053SRui Paulo 
11e28a4053SRui Paulo #include "common.h"
12e28a4053SRui Paulo #include "dh_groups.h"
13e28a4053SRui Paulo #include "dh_group5.h"
14e28a4053SRui Paulo 
15e28a4053SRui Paulo 
dh5_init(struct wpabuf ** priv,struct wpabuf ** publ)16e28a4053SRui Paulo void * dh5_init(struct wpabuf **priv, struct wpabuf **publ)
17e28a4053SRui Paulo {
18*780fb4a2SCy Schubert 	wpabuf_free(*publ);
19e28a4053SRui Paulo 	*publ = dh_init(dh_groups_get(5), priv);
20f05cddf9SRui Paulo 	if (*publ == NULL)
21e28a4053SRui Paulo 		return NULL;
22e28a4053SRui Paulo 	return (void *) 1;
23e28a4053SRui Paulo }
24e28a4053SRui Paulo 
25e28a4053SRui Paulo 
dh5_init_fixed(const struct wpabuf * priv,const struct wpabuf * publ)26f05cddf9SRui Paulo void * dh5_init_fixed(const struct wpabuf *priv, const struct wpabuf *publ)
27f05cddf9SRui Paulo {
28f05cddf9SRui Paulo 	return (void *) 1;
29f05cddf9SRui Paulo }
30f05cddf9SRui Paulo 
31f05cddf9SRui Paulo 
dh5_derive_shared(void * ctx,const struct wpabuf * peer_public,const struct wpabuf * own_private)32e28a4053SRui Paulo struct wpabuf * dh5_derive_shared(void *ctx, const struct wpabuf *peer_public,
33e28a4053SRui Paulo 				  const struct wpabuf *own_private)
34e28a4053SRui Paulo {
35e28a4053SRui Paulo 	return dh_derive_shared(peer_public, own_private, dh_groups_get(5));
36e28a4053SRui Paulo }
37e28a4053SRui Paulo 
38e28a4053SRui Paulo 
dh5_free(void * ctx)39e28a4053SRui Paulo void dh5_free(void *ctx)
40e28a4053SRui Paulo {
41e28a4053SRui Paulo }
42