2 * Copyright (C) 2012 Reto Buerki
3 * Copyright (C) 2012 Adrian-Ken Rueegsegger
5 * Copyright (C) secunet Security Networks AG
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 * @defgroup tkm-dh diffie hellman
23 #ifndef TKM_DIFFIE_HELLMAN_H_
24 #define TKM_DIFFIE_HELLMAN_H_
26 typedef struct tkm_diffie_hellman_t tkm_diffie_hellman_t
;
29 #include <tkm/types.h>
32 * diffie_hellman_t implementation using the trusted key manager.
34 struct tkm_diffie_hellman_t
{
37 * Implements diffie_hellman_t interface.
42 * Get Diffie-Hellman context id.
44 * @return id of this DH context.
46 dh_id_type (*get_id
)(tkm_diffie_hellman_t
* const this);
51 * Loads IANA DH group identifier to TKM id mapping from config and registers
52 * the corresponding DH features.
54 * @return number of registered mappings
56 int register_dh_mapping();
59 * Destroy IANA DH group identifier to TKM id mapping.
61 void destroy_dh_mapping();
64 * Creates a new tkm_diffie_hellman_t object.
66 * @param group Diffie Hellman group number to use
67 * @return tkm_diffie_hellman_t object, NULL if not supported
69 tkm_diffie_hellman_t
*tkm_diffie_hellman_create(diffie_hellman_group_t group
);
71 #endif /** TKM_DIFFIE_HELLMAN_H_ @}*/