Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# aesopt.h File Reference

`#include "aes.h"`
`#include <stdlib.h>`
`#include <sys/param.h>`

Include dependency graph for aesopt.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | NO_TABLES 0
#define | ONE_TABLE 1
#define | FOUR_TABLES 4
#define | NONE 0
#define | PARTIAL 1
#define | FULL 2
#define | AES_LITTLE_ENDIAN 1234
#define | AES_BIG_ENDIAN 4321
#define | ENCRYPTION
#define | ENCRYPTION_KEY_SCHEDULE
#define | DECRYPTION
#define | DECRYPTION_KEY_SCHEDULE
#define | INTERNAL_BYTE_ORDER PLATFORM_BYTE_ORDER
#define | SAFE_IO
#define | ENC_UNROLL FULL
#define | DEC_UNROLL FULL
#define | FF_TABLES
#define | ARRAYS
#define | s(x, c) x[c]
#define | FIXED_TABLES
#define | TABLE_ALIGN 64
#define | ENC_ROUND FOUR_TABLES
#define | LAST_ENC_ROUND FOUR_TABLES
#define | DEC_ROUND FOUR_TABLES
#define | LAST_DEC_ROUND FOUR_TABLES
#define | KEY_SCHED FOUR_TABLES
#define | RC_LENGTH (5 * (AES_BLOCK_SIZE / 4 - 2))
#define | word_in(x, c)
#define | word_out(x, c, v)
#define | WPOLY 0x011b
#define | BPOLY 0x1b
#define | m1 0x80808080
#define | m2 0x7f7f7f7f
#define | gf_mulx(x) ((((x) & m2) << 1) ^ ((((x) & m1) >> 7) * BPOLY))
#define | FT4_SET
#define | FL4_SET
#define | IT4_SET
#define | IL4_SET
#define | LS4_SET
#define | IM4_SET
#define | t_dec(m, n) t_##m##n
#define | t_set(m, n) t_##m##n
#define | t_use(m, n) t_##m##n
#define | d_1(t, n, b, v) extern const t n[256]
#define | d_4(t, n, b, v) extern const t n[4][256]
#define | no_table(x, box, vf, rf, c)
#define | one_table(x, op, tab, vf, rf, c)
#define | four_tables(x, tab, vf, rf, c)
#define | vf1(x, r, c) (x)
#define | rf1(r, c) (r)
#define | rf2(r, c) ((8+r-c)&3)
#define | dec_fmvars aes_32t g2
#define | fwd_mcol(x) (g2 = gf_mulx(x), g2 ^ upr((x) ^ g2, 3) ^ upr((x), 2) ^ upr((x), 1))
#define | inv_mcol(x) four_tables(x,t_use(i,m),vf1,rf1,0)
#define | ls_box(x, c) four_tables(x,t_use(f,l),vf1,rf2,c)
## Variables
const aes_32t | t_rc [(5 *(16/4-2))]
const aes_32t | t_fn [4][256]
const aes_32t | t_fl [4][256]
const aes_32t | t_in [4][256]
const aes_32t | t_il [4][256]
const aes_32t | t_im [4][256]

## Define Documentation

#define AES_BIG_ENDIAN 4321

#define AES_LITTLE_ENDIAN 1234

#define ARRAYS

#define BPOLY 0x1b

#define d_1 | ( | t,
|  | n,
|  | b,
|  | v |  | ) | extern const t n[256]

#define d_4 | ( | t,
|  | n,
|  | b,
|  | v |  | ) | extern const t n[4][256]

#define dec_fmvars aes_32t g2

#define DEC_ROUND FOUR_TABLES

#define DEC_UNROLL FULL

#define DECRYPTION

#define DECRYPTION_KEY_SCHEDULE

#define ENC_ROUND FOUR_TABLES

#define ENC_UNROLL FULL

#define ENCRYPTION

#define ENCRYPTION_KEY_SCHEDULE

#define FF_TABLES

#define FIXED_TABLES

#define FL4_SET

#define four_tables | ( | x,
|  | tab,
|  | vf,
|  | rf,
|  | c |  | ) |

| Value:
    (  tab[0][bval(vf(x,0,c),rf(0,c))] \
      ^ tab[1][bval(vf(x,1,c),rf(1,c))] \
      ^ tab[2][bval(vf(x,2,c),rf(2,c))] \
      ^ tab[3][bval(vf(x,3,c),rf(3,c))])

#define FOUR_TABLES 4

#define FT4_SET

#define FULL 2

#define fwd_mcol | ( | x |  | ) | (g2 = gf_mulx(x), g2 ^ upr((x) ^ g2, 3) ^ upr((x), 2) ^ upr((x), 1))

#define gf_mulx | ( | x |  | ) | ((((x) & m2) << 1) ^ ((((x) & m1) >> 7) * BPOLY))

#define IL4_SET

#define IM4_SET

#define INTERNAL_BYTE_ORDER PLATFORM_BYTE_ORDER

#define inv_mcol | ( | x |  | ) | four_tables(x,t_use(i,m),vf1,rf1,0)

#define IT4_SET

#define KEY_SCHED FOUR_TABLES

#define LAST_DEC_ROUND FOUR_TABLES

#define LAST_ENC_ROUND FOUR_TABLES

#define LS4_SET

#define ls_box | ( | x,
|  | c |  | ) | four_tables(x,t_use(f,l),vf1,rf2,c)

#define m1 0x80808080

#define m2 0x7f7f7f7f

#define no_table | ( | x,
|  | box,
|  | vf,
|  | rf,
|  | c |  | ) |

| Value:
    bytes2word( \
        box[bval(vf(x,0,c),rf(0,c))], \
        box[bval(vf(x,1,c),rf(1,c))], \
        box[bval(vf(x,2,c),rf(2,c))], \
        box[bval(vf(x,3,c),rf(3,c))])

#define NO_TABLES 0

#define NONE 0

#define one_table | ( | x,
|  | op,
|  | tab,
|  | vf,
|  | rf,
|  | c |  | ) |

| Value:
    (     tab[bval(vf(x,0,c),rf(0,c))] \
      ^ op(tab[bval(vf(x,1,c),rf(1,c))],1) \
      ^ op(tab[bval(vf(x,2,c),rf(2,c))],2) \
      ^ op(tab[bval(vf(x,3,c),rf(3,c))],3))

#define ONE_TABLE 1

#define PARTIAL 1

#define RC_LENGTH (5 * (AES_BLOCK_SIZE / 4 - 2))

#define rf1 | ( | r,
|  | c |  | ) | (r)

#define rf2 | ( | r,
|  | c |  | ) | ((8+r-c)&3)

#define s | ( | x,
|  | c |  | ) | x[c]

#define SAFE_IO

#define t_dec | ( | m,
|  | n |  | ) | t_##m##n

#define t_set | ( | m,
|  | n |  | ) | t_##m##n

#define t_use | ( | m,
|  | n |  | ) | t_##m##n

#define TABLE_ALIGN 64

#define vf1 | ( | x,
|  | r,
|  | c |  | ) | (x)

#define word_in | ( | x,
|  | c |  | ) |

| Value:
    bytes2word(((aes_08t*)(x)+4*c)[0], ((aes_08t*)(x)+4*c)[1], \
                                       ((aes_08t*)(x)+4*c)[2], ((aes_08t*)(x)+4*c)[3])

#define word_out | ( | x,
|  | c,
|  | v |  | ) |

| Value:
    { ((aes_08t*)(x)+4*c)[0] = bval(v,0); ((aes_08t*)(x)+4*c)[1] = bval(v,1); \
                              ((aes_08t*)(x)+4*c)[2] = bval(v,2); ((aes_08t*)(x)+4*c)[3] = bval(v,3); }

#define WPOLY 0x011b

## Variable Documentation

const aes_32t t_fl[4][256]

const aes_32t t_fn[4][256]

const aes_32t t_il[4][256]

const aes_32t t_im[4][256]

const aes_32t t_in[4][256]

const aes_32t t_rc[ (5 * ( 16 / 4 - 2)) ]