Loading...
Searching...
No Matches
aes_i.h File Reference

AES (Rijndael) cipher. More...

`#include "aes.h"`

Go to the source code of this file.

## Macros

#define | AES_SMALL_TABLES
#define | RCON(i)
#define | TE0(i)
#define | TE1(i)
#define | TE2(i)
#define | TE3(i)
#define | TE41(i)
#define | TE42(i)
#define | TE43(i)
#define | TE44(i)
#define | TE421(i)
#define | TE432(i)
#define | TE443(i)
#define | TE414(i)
#define | TE4(i)
#define | TD0(i)
#define | TD1(i)
#define | TD2(i)
#define | TD3(i)
#define | TD41(i)
#define | TD42(i)
#define | TD43(i)
#define | TD44(i)
#define | TD0_(i)
#define | TD1_(i)
#define | TD2_(i)
#define | TD3_(i)
#define | GETU32(pt)
#define | PUTU32(ct, st)
#define | AES_PRIV_SIZE (4 * 44)

## Functions

static u32 | rotr (u32 val, int bits)
void | rijndaelKeySetupEnc (u32 rk[], const u8 cipherKey[])
| Expand the cipher key into the encryption key schedule.

## Variables

const u32 | Te0 [256]
const u32 | Te1 [256]
const u32 | Te2 [256]
const u32 | Te3 [256]
const u32 | Te4 [256]
const u32 | Td0 [256]
const u32 | Td1 [256]
const u32 | Td2 [256]
const u32 | Td3 [256]
const u32 | Td4 [256]
const u32 | rcon [10]
const u8 | Td4s [256]
const u8 | rcons [10]

## Detailed Description

AES (Rijndael) cipher.

## Macro Definition Documentation

## AES_PRIV_SIZE

#define AES_PRIV_SIZE (4 * 44)

Referenced by aes_encrypt_deinit(), and aes_encrypt_init().

## AES_SMALL_TABLES

#define AES_SMALL_TABLES

## GETU32

#define GETU32 | ( |  | pt | ) |

Value:
(((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ \
((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
u32
uint32_t u32
Definition common.h:25

Referenced by rijndaelEncrypt(), and rijndaelKeySetupEnc().

## PUTU32

#define PUTU32 | ( |  | ct,
|  |  | st )

Value:
{ \
(ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); \
(ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); }
u8
uint8_t u8
Definition common.h:27

Referenced by rijndaelEncrypt().

## RCON

#define RCON | ( |  | i | ) |

Value:
((u32)rcons[(i)] << 24)
rcons
const u8 rcons[]
Definition aes-internal.c:779

Referenced by rijndaelKeySetupEnc().

## TD0

#define TD0 | ( |  | i | ) |

Value:
Td0[((i) >> 24) & 0xff]
Td0
const u32 Td0[256]
Definition aes-internal.c:407

## TD0_

#define TD0_ | ( |  | i | ) |

Value:
Td0[(i) & 0xff]

## TD1

#define TD1 | ( |  | i | ) |

Value:
rotr(Td0[((i) >> 16) & 0xff], 8)
rotr
static u32 rotr(u32 val, int bits)
Definition aes_i.h:74

## TD1_

#define TD1_ | ( |  | i | ) |

Value:
rotr(Td0[(i) & 0xff], 8)

## TD2

#define TD2 | ( |  | i | ) |

Value:
rotr(Td0[((i) >> 8) & 0xff], 16)

## TD2_

#define TD2_ | ( |  | i | ) |

Value:
rotr(Td0[(i) & 0xff], 16)

## TD3

#define TD3 | ( |  | i | ) |

Value:
rotr(Td0[(i) & 0xff], 24)

## TD3_

#define TD3_ | ( |  | i | ) |

Value:
rotr(Td0[(i) & 0xff], 24)

## TD41

#define TD41 | ( |  | i | ) |

Value:
(Td4s[((i) >> 24) & 0xff] << 24)
Td4s
const u8 Td4s[256]
Definition aes-internal.c:745

## TD42

#define TD42 | ( |  | i | ) |

Value:
(Td4s[((i) >> 16) & 0xff] << 16)

## TD43

#define TD43 | ( |  | i | ) |

Value:
(Td4s[((i) >> 8) & 0xff] << 8)

## TD44

#define TD44 | ( |  | i | ) |

Value:
(Td4s[(i) & 0xff])

## TE0

#define TE0 | ( |  | i | ) |

Value:
Te0[((i) >> 24) & 0xff]
Te0
const u32 Te0[256]
Definition aes-internal.c:74

## TE1

#define TE1 | ( |  | i | ) |

Value:
rotr(Te0[((i) >> 16) & 0xff], 8)

## TE2

#define TE2 | ( |  | i | ) |

Value:
rotr(Te0[((i) >> 8) & 0xff], 16)

## TE3

#define TE3 | ( |  | i | ) |

Value:
rotr(Te0[(i) & 0xff], 24)

## TE4

#define TE4 | ( |  | i | ) |

Value:
((Te0[(i)] >> 8) & 0x000000ff)

## TE41

#define TE41 | ( |  | i | ) |

Value:
((Te0[((i) >> 24) & 0xff] << 8) & 0xff000000)

Referenced by rijndaelEncrypt().

## TE414

#define TE414 | ( |  | i | ) |

Value:
((Te0[((i) >> 24) & 0xff] >> 8) & 0x000000ff)

Referenced by rijndaelKeySetupEnc().

## TE42

#define TE42 | ( |  | i | ) |

Value:
(Te0[((i) >> 16) & 0xff] & 0x00ff0000)

Referenced by rijndaelEncrypt().

## TE421

#define TE421 | ( |  | i | ) |

Value:
((Te0[((i) >> 16) & 0xff] << 8) & 0xff000000)

Referenced by rijndaelKeySetupEnc().

## TE43

#define TE43 | ( |  | i | ) |

Value:
(Te0[((i) >> 8) & 0xff] & 0x0000ff00)

Referenced by rijndaelEncrypt().

## TE432

#define TE432 | ( |  | i | ) |

Value:
(Te0[((i) >> 8) & 0xff] & 0x00ff0000)

Referenced by rijndaelKeySetupEnc().

## TE44

#define TE44 | ( |  | i | ) |

Value:
((Te0[(i) & 0xff] >> 8) & 0x000000ff)

Referenced by rijndaelEncrypt().

## TE443

#define TE443 | ( |  | i | ) |

Value:
(Te0[(i) & 0xff] & 0x0000ff00)

Referenced by rijndaelKeySetupEnc().

## Function Documentation

## rijndaelKeySetupEnc()

void rijndaelKeySetupEnc | ( | u32 | rk[],
|  | const u8 | cipherKey[] )

Expand the cipher key into the encryption key schedule.

Returns
  the number of rounds for the given cipher key size.

References GETU32, RCON, TE414, TE421, TE432, and TE443.

Referenced by aes_encrypt_init().

## rotr()

u32 rotr | ( | u32 | val,
|  | int | bits )

inline static

## Variable Documentation

## rcon

const u32 rcon[10]

extern

## rcons

const u8 rcons[10]

extern

## Td0

const u32 Td0[256]

extern

## Td1

const u32 Td1[256]

extern

## Td2

const u32 Td2[256]

extern

## Td3

const u32 Td3[256]

extern

## Td4

const u32 Td4[256]

extern

## Td4s

const u8 Td4s[256]

extern

## Te0

const u32 Te0[256]

extern

## Te1

const u32 Te1[256]

extern

## Te2

const u32 Te2[256]

extern

## Te3

const u32 Te3[256]

extern

## Te4

const u32 Te4[256]

extern