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

AES (Rijndael) cipher - decrypt. More...

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

Macros

#define ROUND(i, d, s)
 

Functions

void * aes_decrypt_init (const u8 *key, size_t len)
 Initialize AES for decryption. More...
 
void aes_decrypt (void *ctx, const u8 *crypt, u8 *plain)
 Decrypt one AES block. More...
 
void aes_decrypt_deinit (void *ctx)
 Deinitialize AES decryption. More...
 

Detailed Description

AES (Rijndael) cipher - decrypt.

Modifications to public domain implementation:

Macro Definition Documentation

#define ROUND (   i,
  d,
 
)
Value:
d##0 = TD0(s##0) ^ TD1(s##3) ^ TD2(s##2) ^ TD3(s##1) ^ rk[4 * i]; \
d##1 = TD0(s##1) ^ TD1(s##0) ^ TD2(s##3) ^ TD3(s##2) ^ rk[4 * i + 1]; \
d##2 = TD0(s##2) ^ TD1(s##1) ^ TD2(s##0) ^ TD3(s##3) ^ rk[4 * i + 2]; \
d##3 = TD0(s##3) ^ TD1(s##2) ^ TD2(s##1) ^ TD3(s##0) ^ rk[4 * i + 3]

Function Documentation

void aes_decrypt ( void *  ctx,
const u8 *  crypt,
u8 *  plain 
)

Decrypt one AES block.

Parameters
ctxContext pointer from aes_encrypt_init()
cryptEncrypted data (16 bytes)
plainBuffer for the decrypted data (16 bytes)
void aes_decrypt_deinit ( void *  ctx)

Deinitialize AES decryption.

Parameters
ctxContext pointer from aes_encrypt_init()
void* aes_decrypt_init ( const u8 *  key,
size_t  len 
)

Initialize AES for decryption.

Parameters
keyDecryption key
lenKey length in bytes (usually 16, i.e., 128 bits)
Returns
Pointer to context data or NULL on failure