wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
dh_groups.c File Reference

Diffie-Hellman groups. More...

#include "includes.h"
#include "common.h"
#include "crypto.h"
#include "random.h"
#include "dh_groups.h"

Macros

#define DH_GROUP(id, safe)
 
#define NUM_DH_GROUPS   ARRAY_SIZE(dh_groups)
 

Functions

const struct dh_groupdh_groups_get (int id)
 
struct wpabufdh_init (const struct dh_group *dh, struct wpabuf **priv)
 Initialize Diffie-Hellman handshake. More...
 
struct wpabufdh_derive_shared (const struct wpabuf *peer_public, const struct wpabuf *own_private, const struct dh_group *dh)
 Derive shared Diffie-Hellman key. More...
 

Detailed Description

Diffie-Hellman groups.

Macro Definition Documentation

#define DH_GROUP (   id,
  safe 
)
Value:
{ id, dh_group ## id ## _generator, sizeof(dh_group ## id ## _generator), \
dh_group ## id ## _prime, sizeof(dh_group ## id ## _prime), \
dh_group ## id ## _order, sizeof(dh_group ## id ## _order), safe }
Definition: dh_groups.h:8

Function Documentation

struct wpabuf* dh_derive_shared ( const struct wpabuf peer_public,
const struct wpabuf own_private,
const struct dh_group dh 
)

Derive shared Diffie-Hellman key.

Parameters
peer_publicDiffie-Hellman public value from peer
own_privateDiffie-Hellman private key from dh_init()
dhSelected Diffie-Hellman group
Returns
Diffie-Hellman shared key
struct wpabuf* dh_init ( const struct dh_group dh,
struct wpabuf **  priv 
)

Initialize Diffie-Hellman handshake.

Parameters
dhSelected Diffie-Hellman group
privPointer for returning Diffie-Hellman private key
Returns
Diffie-Hellman public value