- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- File List
- File Members

# rijndael.h File Reference

[Internal] AES encoding / decoding rijndael-alg-fst.h v2.0 August '99 Optimised ANSI C code taken from the 'aescrypt' project: www.sf.net/projects/aescrypt See LICENSE-EST for the license applicable to this file More...

`#include <stdio.h>`

## Classes
struct | keyInstance
struct | cipherInstance
## Defines
#define | MAXKC (256/32)
#define | MAXROUNDS 14
#define | DIR_ENCRYPT 0
#define | DIR_DECRYPT 1
#define | MODE_ECB 1
#define | MODE_CBC 2
#define | MODE_CFB1 3
#define | TRUE 1
#define | FALSE 0
#define | BITSPERBLOCK 128
#define | BAD_KEY_DIR -1
#define | BAD_KEY_MAT -2
#define | BAD_KEY_INSTANCE -3
#define | BAD_CIPHER_MODE -4
#define | BAD_CIPHER_STATE -5
#define | BAD_BLOCK_LENGTH -6
#define | BAD_CIPHER_INSTANCE -7
#define | MAX_KEY_SIZE 32
#define | MAX_IV_SIZE 16
## Typedefs
typedef unsigned char | word8
typedef unsigned short | word16
typedef unsigned int | word32
typedef unsigned char | BYTE
## Functions
int | rijndaelKeySched (word8 k[MAXKC][4], int keyBits, word8 rk[MAXROUNDS+1][4][4])
int | rijndaelKeyEnctoDec (int keyBits, word8 W[MAXROUNDS+1][4][4])
int | rijndaelEncrypt (word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4])
int | rijndaelEncryptRound (word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int rounds)
int | rijndaelDecrypt (word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4])
int | rijndaelDecryptRound (word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int rounds)
int | makeKey (keyInstance *key, BYTE direction, int keyLen, char *keyMaterial)
int | cipherInit (cipherInstance *cipher, BYTE mode, char *IV)
int | blockEncrypt (cipherInstance *cipher, keyInstance *key, BYTE *input, int inputLen, BYTE *outBuffer)
int | blockDecrypt (cipherInstance *cipher, keyInstance *key, BYTE *input, int inputLen, BYTE *outBuffer)
int | cipherUpdateRounds (cipherInstance *cipher, keyInstance *key, BYTE *input, int inputLen, BYTE *outBuffer, int Rounds)

## Detailed Description

[Internal] AES encoding / decoding rijndael-alg-fst.h v2.0 August '99 Optimised ANSI C code taken from the 'aescrypt' project: www.sf.net/projects/aescrypt See LICENSE-EST for the license applicable to this file

## Define Documentation

#define MAXKC (256/32)

| Note: Although the routines claim to support 192 and 256 bit blocks, don't take your chances - stick to the 128 bit (16 byte) blocks unless you've run tests to prove that 192 and 256 are correctly supported. Cirilo

## Function Documentation

int cipherUpdateRounds | ( | cipherInstance * | cipher,
|  | keyInstance * | key,
|  | BYTE * | input,
|  | int inputLen | __UNUS,
|  | BYTE * | outBuffer,
|  | int | rounds
| ) |

| cipherUpdateRounds: Encrypts/Decrypts exactly one full block a specified number of rounds. Only used in the Intermediate Value Known Answer Test. Returns: TRUE - on success BAD_CIPHER_STATE - cipher in bad state (e.g., not initialized)