#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) |
|
|
|
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) |