wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
sha1-prf.c File Reference

SHA1-based PRF. More...

#include "includes.h"
#include "common.h"
#include "sha1.h"
#include "crypto.h"

Functions

int sha1_prf (const u8 *key, size_t key_len, const char *label, const u8 *data, size_t data_len, u8 *buf, size_t buf_len)
 SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1) More...
 

Detailed Description

SHA1-based PRF.

Function Documentation

int sha1_prf ( const u8 *  key,
size_t  key_len,
const char *  label,
const u8 *  data,
size_t  data_len,
u8 *  buf,
size_t  buf_len 
)

SHA1-based Pseudo-Random Function (PRF) (IEEE 802.11i, 8.5.1.1)

Parameters
keyKey for PRF
key_lenLength of the key in bytes
labelA unique label for each purpose of the PRF
dataExtra data to bind into the key
data_lenLength of the data
bufBuffer for the generated pseudo-random key
buf_lenNumber of bytes of key to generate
Returns
0 on success, -1 of failure

This function is used to derive new, cryptographically separate keys from a given key (e.g., PMK in IEEE 802.11i).