Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
aes.h File Reference
#include <linux/types.h>
#include <linux/crypto.h>

Go to the source code of this file.

Data Structures

struct  crypto_aes_ctx
 

Macros

#define AES_MIN_KEY_SIZE   16
 
#define AES_MAX_KEY_SIZE   32
 
#define AES_KEYSIZE_128   16
 
#define AES_KEYSIZE_192   24
 
#define AES_KEYSIZE_256   32
 
#define AES_BLOCK_SIZE   16
 
#define AES_MAX_KEYLENGTH   (15 * 16)
 
#define AES_MAX_KEYLENGTH_U32   (AES_MAX_KEYLENGTH / sizeof(u32))
 

Functions

int crypto_aes_set_key (struct crypto_tfm *tfm, const u8 *in_key, unsigned int key_len)
 
int crypto_aes_expand_key (struct crypto_aes_ctx *ctx, const u8 *in_key, unsigned int key_len)
 

Variables

const u32 crypto_ft_tab [4][256]
 
const u32 crypto_fl_tab [4][256]
 
const u32 crypto_it_tab [4][256]
 
const u32 crypto_il_tab [4][256]
 

Macro Definition Documentation

#define AES_BLOCK_SIZE   16

Definition at line 16 of file aes.h.

#define AES_KEYSIZE_128   16

Definition at line 13 of file aes.h.

#define AES_KEYSIZE_192   24

Definition at line 14 of file aes.h.

#define AES_KEYSIZE_256   32

Definition at line 15 of file aes.h.

#define AES_MAX_KEY_SIZE   32

Definition at line 12 of file aes.h.

#define AES_MAX_KEYLENGTH   (15 * 16)

Definition at line 17 of file aes.h.

#define AES_MAX_KEYLENGTH_U32   (AES_MAX_KEYLENGTH / sizeof(u32))

Definition at line 18 of file aes.h.

#define AES_MIN_KEY_SIZE   16

Definition at line 11 of file aes.h.

Function Documentation

int crypto_aes_expand_key ( struct crypto_aes_ctx ctx,
const u8 in_key,
unsigned int  key_len 
)

crypto_aes_expand_key - Expands the AES key as described in FIPS-197 : The location where the computed key will be stored. : The supplied key. : The length of the supplied key.

Returns 0 on success. The function fails only if an invalid key size (or pointer) is supplied. The expanded key size is 240 bytes (max of 14 rounds with a unique 16 bytes key schedule plus a 16 bytes key which is used before the first round). The decryption key is prepared for the "Equivalent Inverse Cipher" as described in FIPS-197. The first slot (16 bytes) of each key (enc or dec) is for the initial combination, the second slot for the first round and so on.

Definition at line 1216 of file aes_generic.c.

int crypto_aes_set_key ( struct crypto_tfm tfm,
const u8 in_key,
unsigned int  key_len 
)

crypto_aes_set_key - Set the AES key. : The crypto_tfm that is used in the context. : The input key. : The size of the key.

Returns 0 on success, on failure the CRYPTO_TFM_RES_BAD_KEY_LEN flag in tfm is set. The function uses crypto_aes_expand_key() to expand the key. &crypto_aes_ctx must be the private data embedded in which is retrieved with crypto_tfm_ctx().

Definition at line 1282 of file aes_generic.c.

Variable Documentation

const u32 crypto_fl_tab[4][256]

Definition at line 329 of file aes_generic.c.

const u32 crypto_ft_tab[4][256]

Definition at line 65 of file aes_generic.c.

const u32 crypto_il_tab[4][256]

Definition at line 857 of file aes_generic.c.

const u32 crypto_it_tab[4][256]

Definition at line 593 of file aes_generic.c.