ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
Macros | Typedefs | Functions
aes.c File Reference
#include <stdint.h>
#include <string.h>
#include "aes.h"
Include dependency graph for aes.c:

Macros

#define Nb   4
 
#define Nk   4
 
#define Nr   10
 
#define getSBoxValue(num)   (sbox[(num)])
 
#define getSBoxInvert(num)   (rsbox[(num)])
 
#define Multiply(x, y)
 

Typedefs

typedef uint8_t state_t[4][4]
 

Functions

void AES_init_ctx_iv (struct AES_ctx *ctx, const uint8_t *key, const uint8_t *iv)
 
void AES_ECB_encrypt (const struct AES_ctx *ctx, uint8_t *buf)
 
void AES_ECB_decrypt (const struct AES_ctx *ctx, uint8_t *buf)
 
void XorWithIv (uint8_t *buf, const uint8_t *Iv)
 
void XorWithByte (uint8_t *buf, uint8_t byte, int length)
 

Macro Definition Documentation

◆ getSBoxInvert

#define getSBoxInvert (   num)    (rsbox[(num)])

◆ getSBoxValue

#define getSBoxValue (   num)    (sbox[(num)])

◆ Multiply

#define Multiply (   x,
 
)
Value:
( ((y & 1) * x) ^ \
((y>>1 & 1) * xtime(x)) ^ \
((y>>2 & 1) * xtime(xtime(x))) ^ \
((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ \
((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))) \

◆ Nb

#define Nb   4

◆ Nk

#define Nk   4

◆ Nr

#define Nr   10

Typedef Documentation

◆ state_t

typedef uint8_t state_t[4][4]

Function Documentation

◆ AES_ECB_decrypt()

void AES_ECB_decrypt ( const struct AES_ctx ctx,
uint8_t *  buf 
)

◆ AES_ECB_encrypt()

void AES_ECB_encrypt ( const struct AES_ctx ctx,
uint8_t *  buf 
)

◆ AES_init_ctx_iv()

void AES_init_ctx_iv ( struct AES_ctx ctx,
const uint8_t *  key,
const uint8_t *  iv 
)

◆ XorWithByte()

void XorWithByte ( uint8_t *  buf,
uint8_t  byte,
int  length 
)

◆ XorWithIv()

void XorWithIv ( uint8_t *  buf,
const uint8_t *  Iv 
)