The required constant definitions are as follows:
#define MODULE_NAME AES /* Name of algorithm */ #define BLOCK_SIZE 16 /* Size of encryption block */ #define KEY_SIZE 0 /* Size of key in bytes (0 if not fixed size) */
The C structure must be named block_state:
typedef struct { ... whatever state variables you need ... } block_state;
There are three functions that need to be written: to initialize the algorithm's state, and to encrypt and decrypt a single block.
void block_init(block_state *self, unsigned char *key,
int keylen);
void block_encrypt(block_state *self, unsigned char *in,
unsigned char *out);
void block_decrypt(block_state *self, unsigned char *in,
unsigned char *out);
Put #include "block_template.c"
at the end of the file to
include the actual implementation of the module.