1e5b75505Sopenharmony_ci/* 2e5b75505Sopenharmony_ci * Diffie-Hellman group 5 operations 3e5b75505Sopenharmony_ci * Copyright (c) 2009, 2012, 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#include "includes.h" 10e5b75505Sopenharmony_ci 11e5b75505Sopenharmony_ci#include "common.h" 12e5b75505Sopenharmony_ci#include "dh_groups.h" 13e5b75505Sopenharmony_ci#include "dh_group5.h" 14e5b75505Sopenharmony_ci 15e5b75505Sopenharmony_ci 16e5b75505Sopenharmony_civoid * dh5_init(struct wpabuf **priv, struct wpabuf **publ) 17e5b75505Sopenharmony_ci{ 18e5b75505Sopenharmony_ci wpabuf_free(*publ); 19e5b75505Sopenharmony_ci *publ = dh_init(dh_groups_get(5), priv); 20e5b75505Sopenharmony_ci if (*publ == NULL) 21e5b75505Sopenharmony_ci return NULL; 22e5b75505Sopenharmony_ci return (void *) 1; 23e5b75505Sopenharmony_ci} 24e5b75505Sopenharmony_ci 25e5b75505Sopenharmony_ci 26e5b75505Sopenharmony_civoid * dh5_init_fixed(const struct wpabuf *priv, const struct wpabuf *publ) 27e5b75505Sopenharmony_ci{ 28e5b75505Sopenharmony_ci return (void *) 1; 29e5b75505Sopenharmony_ci} 30e5b75505Sopenharmony_ci 31e5b75505Sopenharmony_ci 32e5b75505Sopenharmony_cistruct wpabuf * dh5_derive_shared(void *ctx, const struct wpabuf *peer_public, 33e5b75505Sopenharmony_ci const struct wpabuf *own_private) 34e5b75505Sopenharmony_ci{ 35e5b75505Sopenharmony_ci return dh_derive_shared(peer_public, own_private, dh_groups_get(5)); 36e5b75505Sopenharmony_ci} 37e5b75505Sopenharmony_ci 38e5b75505Sopenharmony_ci 39e5b75505Sopenharmony_civoid dh5_free(void *ctx) 40e5b75505Sopenharmony_ci{ 41e5b75505Sopenharmony_ci} 42