#include <crypto/aes.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/crypto.h>
#include <asm/byteorder.h>
Go to the source code of this file.
|
#define | star_x(x) (((x) & 0x7f7f7f7f) << 1) ^ ((((x) & 0x80808080) >> 7) * 0x1b) |
|
#define | imix_col(y, x) |
|
#define | ls_box(x) |
|
#define | loop4(i) |
|
#define | loop6(i) |
|
#define | loop8tophalf(i) |
|
#define | loop8(i) |
|
#define | f_rn(bo, bi, n, k) |
|
#define | f_nround(bo, bi, k) |
|
#define | f_rl(bo, bi, n, k) |
|
#define | f_lround(bo, bi, k) |
|
#define | i_rn(bo, bi, n, k) |
|
#define | i_nround(bo, bi, k) |
|
#define | i_rl(bo, bi, n, k) |
|
#define | i_lround(bo, bi, k) |
|
#define f_lround |
( |
|
bo, |
|
|
|
bi, |
|
|
|
k |
|
) |
| |
#define f_nround |
( |
|
bo, |
|
|
|
bi, |
|
|
|
k |
|
) |
| |
#define f_rl |
( |
|
bo, |
|
|
|
bi, |
|
|
|
n, |
|
|
|
k |
|
) |
| |
Value:do { \
crypto_fl_tab[1][
byte(
bi[(
n + 1) & 3], 1)] ^ \
crypto_fl_tab[2][
byte(
bi[(
n + 2) & 3], 2)] ^ \
crypto_fl_tab[3][
byte(
bi[(
n + 3) & 3], 3)] ^ *(
k +
n); \
} while (0)
Definition at line 1315 of file aes_generic.c.
#define f_rn |
( |
|
bo, |
|
|
|
bi, |
|
|
|
n, |
|
|
|
k |
|
) |
| |
Value:do { \
crypto_ft_tab[1][
byte(
bi[(
n + 1) & 3], 1)] ^ \
crypto_ft_tab[2][
byte(
bi[(
n + 2) & 3], 2)] ^ \
crypto_ft_tab[3][
byte(
bi[(
n + 3) & 3], 3)] ^ *(
k +
n); \
} while (0)
Definition at line 1300 of file aes_generic.c.
#define i_lround |
( |
|
bo, |
|
|
|
bi, |
|
|
|
k |
|
) |
| |
#define i_nround |
( |
|
bo, |
|
|
|
bi, |
|
|
|
k |
|
) |
| |
#define i_rl |
( |
|
bo, |
|
|
|
bi, |
|
|
|
n, |
|
|
|
k |
|
) |
| |
Value:do { \
crypto_il_tab[1][
byte(
bi[(
n + 3) & 3], 1)] ^ \
crypto_il_tab[2][
byte(
bi[(
n + 2) & 3], 2)] ^ \
crypto_il_tab[3][
byte(
bi[(
n + 1) & 3], 3)] ^ *(
k +
n); \
} while (0)
Definition at line 1387 of file aes_generic.c.
#define i_rn |
( |
|
bo, |
|
|
|
bi, |
|
|
|
n, |
|
|
|
k |
|
) |
| |
Value:do { \
crypto_it_tab[1][
byte(
bi[(
n + 3) & 3], 1)] ^ \
crypto_it_tab[2][
byte(
bi[(
n + 2) & 3], 2)] ^ \
crypto_it_tab[3][
byte(
bi[(
n + 1) & 3], 3)] ^ *(
k +
n); \
} while (0)
Definition at line 1372 of file aes_generic.c.
#define imix_col |
( |
|
y, |
|
|
|
x |
|
) |
| |
Value:do { \
(
y) ^= ror32(
u ^
t, 8) ^ \
ror32(t, 24); \
} while (0)
Definition at line 1130 of file aes_generic.c.
Value:do { \
t ^=
ctx->key_enc[4 *
i]; \
ctx->key_enc[4 *
i + 4] =
t; \
t ^=
ctx->key_enc[4 *
i + 1]; \
ctx->key_enc[4 *
i + 5] =
t; \
t ^=
ctx->key_enc[4 *
i + 2]; \
ctx->key_enc[4 *
i + 6] =
t; \
t ^=
ctx->key_enc[4 *
i + 3]; \
ctx->key_enc[4 *
i + 7] =
t; \
} while (0)
Definition at line 1147 of file aes_generic.c.
Value:do { \
t ^=
ctx->key_enc[6 *
i]; \
ctx->key_enc[6 *
i + 6] =
t; \
t ^=
ctx->key_enc[6 *
i + 1]; \
ctx->key_enc[6 *
i + 7] =
t; \
t ^=
ctx->key_enc[6 *
i + 2]; \
ctx->key_enc[6 *
i + 8] =
t; \
t ^=
ctx->key_enc[6 *
i + 3]; \
ctx->key_enc[6 *
i + 9] =
t; \
t ^=
ctx->key_enc[6 *
i + 4]; \
ctx->key_enc[6 *
i + 10] =
t; \
t ^=
ctx->key_enc[6 *
i + 5]; \
ctx->key_enc[6 *
i + 11] =
t; \
} while (0)
Definition at line 1160 of file aes_generic.c.
Value:do { \
ctx->key_enc[8 *
i + 12] =
t; \
t ^=
ctx->key_enc[8 *
i + 5]; \
ctx->key_enc[8 *
i + 13] =
t; \
t ^=
ctx->key_enc[8 *
i + 6]; \
ctx->key_enc[8 *
i + 14] =
t; \
t ^=
ctx->key_enc[8 *
i + 7]; \
ctx->key_enc[8 *
i + 15] =
t; \
} while (0)
Definition at line 1190 of file aes_generic.c.
#define loop8tophalf |
( |
|
i | ) |
|
Value:do { \
t ^=
ctx->key_enc[8 *
i]; \
ctx->key_enc[8 *
i + 8] =
t; \
t ^=
ctx->key_enc[8 *
i + 1]; \
ctx->key_enc[8 *
i + 9] =
t; \
t ^=
ctx->key_enc[8 *
i + 2]; \
ctx->key_enc[8 *
i + 10] =
t; \
t ^=
ctx->key_enc[8 *
i + 3]; \
ctx->key_enc[8 *
i + 11] =
t; \
} while (0)
Definition at line 1177 of file aes_generic.c.
#define star_x |
( |
|
x | ) |
(((x) & 0x7f7f7f7f) << 1) ^ ((((x) & 0x80808080) >> 7) * 0x1b) |
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.
MODULE_DESCRIPTION |
( |
"Rijndael (AES) Cipher Algorithm" |
| ) |
|
MODULE_LICENSE |
( |
"Dual BSD/GPL" |
| ) |
|