Turnstone Operating System
|
AES encryption and decryption functions. More...
Macros | |
#define | GET_UINT32_LE(n, b, i) |
#define | PUT_UINT32_LE(n, b, i) |
#define | AES_FROUND(X0, X1, X2, X3, Y0, Y1, Y2, Y3) |
#define | AES_RROUND(X0, X1, X2, X3, Y0, Y1, Y2, Y3) |
#define | ROTL8(x) ( ( x << 8 ) & 0xFFFFFFFF ) | ( x >> 24 ) |
#define | XTIME(x) ( ( x << 1 ) ^ ( ( x & 0x80 ) ? 0x1B : 0x00 ) ) |
#define | MUL(x, y) ( ( x && y ) ? pow[(log[x] + log[y]) % 255] : 0 ) |
#define | MIX(x, y) { y = ( (y << 1) | (y >> 7) ) & 0xFF; x ^= y; } |
#define | CPY128 |
Functions | |
MODULE ("turnstone.lib.crypto") | |
int32_t | aes_set_encryption_key (aes_context_t *ctx, const uint8_t *key, uint32_t keysize) |
int32_t | aes_set_decryption_key (aes_context_t *ctx, const uint8_t *key, uint32_t keysize) |
void | aes_init_keygen_tables (void) |
int32_t | aes_setkey (aes_context_t *ctx, int32_t mode, const uint8_t *key, uint32_t keysize) |
int32_t | aes_cipher (aes_context_t *ctx, const uint8_t input[16], uint8_t output[16]) |
Variables | |
static int32_t | aes_tables_inited = 0 |
static uint8_t | AES_FSb [256] = {0} |
static uint32_t | AES_FT0 [256] = {0} |
static uint32_t | AES_FT1 [256] = {0} |
static uint32_t | AES_FT2 [256] = {0} |
static uint32_t | AES_FT3 [256] = {0} |
static uint8_t | AES_RSb [256] = {0} |
static uint32_t | AES_RT0 [256] = {0} |
static uint32_t | AES_RT1 [256] = {0} |
static uint32_t | AES_RT2 [256] = {0} |
static uint32_t | AES_RT3 [256] = {0} |
static uint32_t | AES_RCON [10] = {0} |
AES encryption and decryption functions.
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define AES_FROUND | ( | X0, | |
X1, | |||
X2, | |||
X3, | |||
Y0, | |||
Y1, | |||
Y2, | |||
Y3 | |||
) |
#define AES_RROUND | ( | X0, | |
X1, | |||
X2, | |||
X3, | |||
Y0, | |||
Y1, | |||
Y2, | |||
Y3 | |||
) |
#define CPY128 |
#define GET_UINT32_LE | ( | n, | |
b, | |||
i | |||
) |