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

AES-128 EAX. More...

#include "includes.h"
#include "common.h"
#include "aes.h"
#include "aes_wrap.h"

Functions

int aes_128_eax_encrypt (const u8 *key, const u8 *nonce, size_t nonce_len, const u8 *hdr, size_t hdr_len, u8 *data, size_t data_len, u8 *tag)
 AES-128 EAX mode encryption. More...
 
int aes_128_eax_decrypt (const u8 *key, const u8 *nonce, size_t nonce_len, const u8 *hdr, size_t hdr_len, u8 *data, size_t data_len, const u8 *tag)
 AES-128 EAX mode decryption. More...
 

Detailed Description

AES-128 EAX.

Function Documentation

int aes_128_eax_decrypt ( const u8 *  key,
const u8 *  nonce,
size_t  nonce_len,
const u8 *  hdr,
size_t  hdr_len,
u8 *  data,
size_t  data_len,
const u8 *  tag 
)

AES-128 EAX mode decryption.

Parameters
keyKey for decryption (16 bytes)
nonceNonce for counter mode
nonce_lenNonce length in bytes
hdrHeader data to be authenticity protected
hdr_lenLength of the header data bytes
dataData to encrypt in-place
data_lenLength of data in bytes
tag16-byte tag value
Returns
0 on success, -1 on failure, -2 if tag does not match
int aes_128_eax_encrypt ( const u8 *  key,
const u8 *  nonce,
size_t  nonce_len,
const u8 *  hdr,
size_t  hdr_len,
u8 *  data,
size_t  data_len,
u8 *  tag 
)

AES-128 EAX mode encryption.

Parameters
keyKey for encryption (16 bytes)
nonceNonce for counter mode
nonce_lenNonce length in bytes
hdrHeader data to be authenticity protected
hdr_lenLength of the header data bytes
dataData to encrypt in-place
data_lenLength of data in bytes
tag16-byte tag value
Returns
0 on success, -1 on failure