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

One-key CBC MAC (OMAC1) hash with AES. More...

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

Functions

int omac1_aes_vector (const u8 *key, size_t key_len, size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
 One-Key CBC MAC (OMAC1) hash with AES. More...
 
int omac1_aes_128_vector (const u8 *key, size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
 One-Key CBC MAC (OMAC1) hash with AES-128. More...
 
int omac1_aes_128 (const u8 *key, const u8 *data, size_t data_len, u8 *mac)
 One-Key CBC MAC (OMAC1) hash with AES-128 (aka AES-CMAC) More...
 
int omac1_aes_256 (const u8 *key, const u8 *data, size_t data_len, u8 *mac)
 One-Key CBC MAC (OMAC1) hash with AES-256 (aka AES-CMAC) More...
 

Detailed Description

One-key CBC MAC (OMAC1) hash with AES.

Function Documentation

int omac1_aes_128 ( const u8 *  key,
const u8 *  data,
size_t  data_len,
u8 *  mac 
)

One-Key CBC MAC (OMAC1) hash with AES-128 (aka AES-CMAC)

Parameters
key128-bit key for the hash operation
dataData buffer for which a MAC is determined
data_lenLength of data buffer in bytes
macBuffer for MAC (128 bits, i.e., 16 bytes)
Returns
0 on success, -1 on failure

This is a mode for using block cipher (AES in this case) for authentication. OMAC1 was standardized with the name CMAC by NIST in a Special Publication (SP) 800-38B.

int omac1_aes_128_vector ( const u8 *  key,
size_t  num_elem,
const u8 *  addr[],
const size_t *  len,
u8 *  mac 
)

One-Key CBC MAC (OMAC1) hash with AES-128.

Parameters
key128-bit key for the hash operation
num_elemNumber of elements in the data vector
addrPointers to the data areas
lenLengths of the data blocks
macBuffer for MAC (128 bits, i.e., 16 bytes)
Returns
0 on success, -1 on failure

This is a mode for using block cipher (AES in this case) for authentication. OMAC1 was standardized with the name CMAC by NIST in a Special Publication (SP) 800-38B.

int omac1_aes_256 ( const u8 *  key,
const u8 *  data,
size_t  data_len,
u8 *  mac 
)

One-Key CBC MAC (OMAC1) hash with AES-256 (aka AES-CMAC)

Parameters
key256-bit key for the hash operation
dataData buffer for which a MAC is determined
data_lenLength of data buffer in bytes
macBuffer for MAC (128 bits, i.e., 16 bytes)
Returns
0 on success, -1 on failure

This is a mode for using block cipher (AES in this case) for authentication. OMAC1 was standardized with the name CMAC by NIST in a Special Publication (SP) 800-38B.

int omac1_aes_vector ( const u8 *  key,
size_t  key_len,
size_t  num_elem,
const u8 *  addr[],
const size_t *  len,
u8 *  mac 
)

One-Key CBC MAC (OMAC1) hash with AES.

Parameters
keyKey for the hash operation
key_lenKey length in octets
num_elemNumber of elements in the data vector
addrPointers to the data areas
lenLengths of the data blocks
macBuffer for MAC (128 bits, i.e., 16 bytes)
Returns
0 on success, -1 on failure

This is a mode for using block cipher (AES in this case) for authentication. OMAC1 was standardized with the name CMAC by NIST in a Special Publication (SP) 800-38B.